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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

cumulative totals of measure

How to calculate the cumulative totals of measure in following example:expec_cum_closed.PNG

 

 

 

 

 The model contains a date table and fact table called Internal.The measure EOMClosed is obtained by using

EOMClosed = CALCULATE(distinctcount(Internal[ID]),userelationship(Internal[CloseDate],'Date'[Date]))

 

The measure when sliced by Date dim gives me number of tickets that got closed each month.I want to make it like cumulative/running.

 

 EOMOpen is number of open tickets each month sliced by date like :

EOMOpen = CALCULATE(DISTINCTCOUNT([ID]),FILTER(ALL(Internal),(Internal[CloseDate]=blank()||Internal[CloseDate]>EOMONTH([OpenDate],0))&&Internal[FirstDate]<=max('Date'[Date])))

 

I tried to do the same with EOMClosed but turns out the userelationship is not propogating the context to filter function :

EOMClosed = CALCULATE(distinctcount(Internal[ID]),userelationship(Internal[CloseDate],'Date'[Date]),filter(Internal,[CloseDate]<=max(Date[Date]))

 

Pls guide me to fix the EOMClosed to get cumulative values.

Here is a sample file:EOM.PNG

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Try this formula, please.

EOMClosed =
CALCULATE (
    DISTINCTCOUNT ( Internal[ID] ),
    USERELATIONSHIP ( Internal[CloseDate], 'Date'[Date] ),
    FILTER (
        ALL ( 'Date'[Date] ),
        'Date'[Date] <= EOMONTH ( MAX ( 'Internal'[OpenDate] ), 0 )
    ),
    ISBLANK ( Internal[CloseDate] ) = FALSE ()
)

Cumulative_totals_of_measure

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Try this formula, please.

EOMClosed =
CALCULATE (
    DISTINCTCOUNT ( Internal[ID] ),
    USERELATIONSHIP ( Internal[CloseDate], 'Date'[Date] ),
    FILTER (
        ALL ( 'Date'[Date] ),
        'Date'[Date] <= EOMONTH ( MAX ( 'Internal'[OpenDate] ), 0 )
    ),
    ISBLANK ( Internal[CloseDate] ) = FALSE ()
)

Cumulative_totals_of_measure

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.