Convert DAX Calculated Column to a Measure
Results 1 to 4 of 4

Thread: Convert DAX Calculated Column to a Measure

  1. #1
    Board Regular
    Join Date
    Aug 2012
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Convert DAX Calculated Column to a Measure

    Trying to convert a DAX Calculated Column to a Measure with no luck. Any ideas? See below and attached. Thanks.

    Code:
    =CALCULATE (
        DISTINCTCOUNT ( Table1[Patient ID] ),
        FILTER (
            Table1,
            Table1[TotalTime] > Legend[Start]
                && Table1[TotalTime] <= Legend[End]
        )
    )
    https://drive.google.com/open?id=1qG...Fv4pUsGc5ZXggm

  2. #2
    Board Regular MrVillareal's Avatar
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    504
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Convert DAX Calculated Column to a Measure

    You can try DAX code below:

    Code:
    Distinct Count ID:=
    VAR TableList = 
        FILTER(
            VALUES(Table1[TotalTime]),
            Table1[TotalTime] > MIN(Legend[Start]) &&
            Table1[TotalTime] <= MAX(Legend[End])
        )
    RETURN
        CALCULATE(
            DISTINCTCOUNT(Table1[Patient ID]),
            TableList
        )
    Last edited by MrVillareal; Aug 29th, 2019 at 03:19 AM.
    - Posting guidelines, forum rules and terms of use - Try searching for your answer first, see how - Read the FAQs - List of BB codes
    Excel jeanie, MrExcel HTML Maker or Borders-Copy-Paste

  3. #3
    Board Regular
    Join Date
    Aug 2012
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Convert DAX Calculated Column to a Measure

    Thanks MrVillareal. It worked!! Tried using a SUMX expression and just wan't working..this would did..
    Last edited by brawnystaff; Aug 29th, 2019 at 10:06 AM.

  4. #4
    Board Regular MrVillareal's Avatar
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    504
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Convert DAX Calculated Column to a Measure

    Quote Originally Posted by brawnystaff View Post
    Thanks MrVillareal. It worked!! Tried using a SUMX expression and just wan't working..this would did..
    Your welcome!
    - Posting guidelines, forum rules and terms of use - Try searching for your answer first, see how - Read the FAQs - List of BB codes
    Excel jeanie, MrExcel HTML Maker or Borders-Copy-Paste

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •