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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
watje255_ju
Helper III
Helper III

Conditional Formatting Calculation Groups

Hi I am trying to format my calculation group, using this dax expression to make the font of the Budget numbers blue, 

Formatting =
IF (
    SELECTEDVALUE ('Test Calculation group'[Test Calculation group column] ) = "Budget",
    [Sales] ,
    BLANK () )
 
but the conditional formatting is being applied over all of the numbers, not just the budget results. Can someone please tell me why? Thank you! PBIX here Matrix test.pbix

 

1 ACCEPTED SOLUTION

Hi @watje255_ju 

It would have worked but that isn't how you're supposed to create a calcuation item. An item would be something like

CALCULATE ( SELECTEDMEASURE (), SAMEPERIODLASTYEAR ( Dates[Date] ) )

SELECTEDMEASURE stands for whatever measure that you'd want SAMEPERIODLASTYEAR to be applied to in the context of the calculation group.  You can see in the first screenshot of my initital reply how your setup behaves. In one of his videos, the author actually discussed how to create a calculation item

danextian_0-1715074863226.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
watje255_ju
Helper III
Helper III

Thanks for your reply. Well copied on the above, the calculation group was a workaround to get the format i desired Having Sales, Budget, Var as per Page 1 screenshot in the PBIX file. This blog suggests that the conditional formatting should work on individual meaures/calculation items https://www.youtube.com/watch?v=MbxJ1oHHyTg ? Cheers

 

Hi @watje255_ju 

It would have worked but that isn't how you're supposed to create a calcuation item. An item would be something like

CALCULATE ( SELECTEDMEASURE (), SAMEPERIODLASTYEAR ( Dates[Date] ) )

SELECTEDMEASURE stands for whatever measure that you'd want SAMEPERIODLASTYEAR to be applied to in the context of the calculation group.  You can see in the first screenshot of my initital reply how your setup behaves. In one of his videos, the author actually discussed how to create a calculation item

danextian_0-1715074863226.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @watje255_ju ,

 

This isn't how a calculation group is supposed to be used. Whatever you put in the matrix, you'll get the same value for sales, budget and var regardless of the calcution group item if you use like as if you're creating a regular measure. It is supposed to be used in applying repetitive calculations over different measures like YTD, previous year, etc (imagine doing that to 50 measures). So if you put sales in a calculation column, it will apply YTD and previous year calculations on top of the sales measure. The same calculation will be applied if a different measure is used.
With your conditional formatting formula, it doesn't really return blank if the calculation item is Budget as shown on the screenshot below.

danextian_1-1715058877458.png

Instead, you can try a different approach by using a  disconnected table and switching measure formula. Please see the attached pbix.

danextian_2-1715060544892.png

 



 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors