Forum Discussion
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,
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
3 Replies
- danextianSuper 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.Instead, you can try a different approach by using a disconnected table and switching measure formula. Please see the attached pbix.
- watje255_juHelper 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
- danextianSuper User
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