Forum Discussion

Tim_BE's avatar
Tim_BE
New Member
5 years ago
Solved

Power BI - convert Calculated Column into Measure

Hi all,   Hope you can help me out converting a calculated column into a measure. Searched in the forum, but couldn't find a solution that worked well.   I created a calculated column in a data t...
  • AlB's avatar
    5 years ago

    Hi Tim_BE 

    This assumes no relationship between your Calendar and fact table:

     

    OpenCases M =
    VAR currentDate_ =
        MAX ( Calendar[Date] )
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( 'SFDC CASE LIST'[Case Number] ),
            'SFDC CASE LIST'[Opened Date] < currentDate_,
            FILTER (
                ALL ( 'SFDC CASE LIST'[Closed Date] ),
                'SFDC CASE LIST'[Closed Date] > currentDate_
                    || 'SFDC CASE LIST'[Closed Date] = BLANK ()
            )
        )

     

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers