Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

View discussion in a popup

Replying to:
v-cazheng-msft
Community Support

Hi Claus_Vad,

 

You need a calendar table firstly, and you could create it by a Calculated table.

Calendar =
VAR minDate =
    MIN ( 'Fact Table'[start date] )
VAR maxDate =
    TODAY ()
RETURN
    CALENDAR ( minDate, maxDate )

 

Then, you need a Measure to count cases.

Active Case Number =
VAR num =
    CALCULATE (
        COUNT ( 'Fact Table'[case] ),
        FILTER (
            'Fact Table',
            'Fact Table'[start date] <= MAX ( 'Calendar'[Date] )
                && ISBLANK ( 'Fact Table'[end date] )
        )
    )
RETURN
    IF ( ISBLANK ( num ), 0, num )

 

The result looks like this.

 

Also, attached the pbix file.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,                                             

Community Support Team _ Caiyun

View solution in original post