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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dedelman_clng
Community Champion
Community Champion

Using 3 (or more) calculation groups on a visual

Hi. I have recently started using Calculation Groups to streamline financial reports in Power BI. I have one calculation group that is for the Time Period

 

 

 

Current Month (Date = previous month/year)

YTD (TotalYTD, Date < today's month/year)

Total YTD (TotalYTD for all year)

 

 

 

My 2nd calculation group is the for the "Value Type", which is essentially this pattern

 

 

 

Actual (Sum from Actuals table, blank if Time Period = "Total Year")

Budget (Sum from Budget table, blank if Time Period = "Current Month")

Forecast (Sum from Forecast table, blank if Time Period = "YTD")

Variance (subtracting one of the above 3 from another, depending on Time Period)

Variance % (Variance divided by one of the above 3, depending on Time Period) 

 

 

 

I am successful in using the two calculation groups together. However, on different pages of the report, the measures for Actual/Budget/Forecast are different enough that the differences cannot be handled by slicers or filters. 

 

So far, I have created 5 different calculation groups, each having the exact same pattern except for which measure is being used in the items. What I mean by this is that in all "Value Type" groups, calculation items are always

 

 

Active
IF( SELECTEDVALUE( 'Time Period'[Name] ) = "Total Year", BLANK(), IF( [ActMeasure] = 0, BLANK(), [ActMeasure] ) ) / 1000

Budget
IF( SELECTEDVALUE( 'Time Period'[Name] ) = "Curr Month", BLANK(), IF( [BudMeasure] = 0, BLANK(), [BudMeasure] ) ) / 1000

Forecast
IF( SELECTEDVALUE( 'Time Period'[Name] ) = "YTD", BLANK(), IF( [FCMeasure] = 0, BLANK(), [FCMeasure] ) ) / 1000

 

 

...just changing out ActMeasure/BudMeasure/FCMeasure each time (the "/1000" is to force the data into thousands for display purposes).

 

I was trying to see if I could make a 3rd calculation group that would contain the various scenarios that currently have their own "Value Type" calculation group, but I couldn't wrap my head around how a 3-way calculation group would work.

 

The basic visual I'm looking to do is this

 

calc group.png

and the idea would be that the 3rd calculation group would exist on the page as a slicer.

 

Does anyone have experience with using 3 calculation groups on a single visual, or should I just continue cloning the calculation groups for each scenario?

 

Thanks,

David

2 REPLIES 2
lbendlin
Super User
Super User

Before you spend any more effort on this - read up on the new dynamic measure formatting feature in Power BI April 2023.

Hi @lbendlin . Thank you for the reply. I am aware of the new dynamic measure formatting, but I don't think that is my issue (aside from the /1000 part).

 

My issue is that I have several categories that I want to "apply"outside of the Time Period/Value Type "matrix". For example, Category A might be to caluculate Actual/Budget/Forecast with a filter on Account, while Category B is to calculate ActualBudget/Forecast with a filter on Cost Group. So currently I am cloning the Value Type calculation group into standalone calculation groups for each of Category A/Category B/etc.

 

Calc Group "Value Type CatA"
Calculation item "Active"

CALCULATE([MeasureA], FILTER(ALL(Account), Account = "123"))

Calc Group "Value Type CatB"
Calcuation item "Active"

CALCULATE([MeasureA], FILTER(ALL(Cost Group), Cost Group = "ABC"))

 

Everything works as expected by using cloned calculation groups, but it is a lot to maintain. If there was a way to bring in a 3rd calcuation group I wouldn't have to make a clone each time there was a new category of calculation.

 

It's entirely possible that the solution might lie in the data model itself, but before I went to revamp the whole thing I wanted to see if anyone had experience with using the intersection of 3 calculation groups at one time.

 

Thanks,

David

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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