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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculation groups for cumulative total DAX Pattern

I'm playing around with the very helpful cumulative total DAX pattern from @marcorusso and wondered whether it could be turned into a calculation group, providing a flexible way to report cumulative totals for multiple measures

 

I've tried (making a slight change to the published pattern) but I'm doing something wrong - whether because it's not possible or because I just can't figure it out, I don't know : )

 

Is this something anyone else can see a way to achieve?

 

charliedata_0-1610296224327.png

 

 

In contrast, I've used a calculation group to create a Min, Max, Latest pattern for adding data labels to time series data so I'm hopeful it's possible - ends up like this:

charliedata_1-1610296302376.png

 

1 ACCEPTED SOLUTION

Perhaps you want to use:

VAR FirstVisibleDate =
    CALCULATE ( MIN ( _Dates[Date] ), ALLSELECTED ( _Dates ) )

 then you can get rid of the IF statement and add a condition Dates[Date] >= FirstVisibleDate in the CALCULATE function.

View solution in original post

4 REPLIES 4

Perhaps you want to use:

VAR FirstVisibleDate =
    CALCULATE ( MIN ( _Dates[Date] ), ALLSELECTED ( _Dates ) )

 then you can get rid of the IF statement and add a condition Dates[Date] >= FirstVisibleDate in the CALCULATE function.

Anonymous
Not applicable

As aways, @marcorusso, you're an absolute legend

 

Thanks - seems to work perfectly!

 

I'm finding it helpful to use calculation groups in this way and I wondered if I'm doing something unreliable or niche, as I haven't seen other examples of people doing it

 

charliedata_1-1610362693182.png

 

parry2k
Super User
Super User

@Anonymous it is not clear what your expectations are?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k 

 

In my message I posted two pictures. In the first picture, I showed two columns. In the second column, I would like to return cumulative total. I would like to achieve this by having the measure in the "values" part of the visual and the calculation group in the "columns" part:

charliedata_0-1610362443979.png

 

 

However, the calculation doesn't work because the values are clearly not a cumulative total of the first column. 

 

My goal / expectation is for the calculation group to return the cumulative total.

 

Does this make sense?

 

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.