Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe 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.
Hi Everyone,
I've been exploring Calculation groups recently and love how they've let me clean up my measures. I've just run across a strange issue with only one of the calculation items in my calculation group. The calculation Item is called 'KPI Pass %' and conditional formatting is not working on it even though it is working on two other calc items ('Created' and 'KPI Pass' respectively). Here is an example, the cells in each row should be the same colour:
As you can see the conditional formatting is applied to Created and KPI Pass but not to KPI Pass %.
I also get an error when I try to filter other visuals by selecting a value in the KPI Pass % column. The error is Cannot convert [title of matrix from a measure] of type text to type numeric. I am not sure why its trying to convert the title measure of the other matrix to Numeric. I don't get this error if I select a value in the Created or KPI Pass columns.
KPI Pass % calculation item is based on the other two, DAX:
KPI Pass % =
DIVIDE (
CALCULATE ( SELECTEDMEASURE (), DateTypes[Date Types] = "KPI Pass" ),
CALCULATE ( SELECTEDMEASURE (), DateTypes[Date Types] = "Created" )
)
I think the problem might be that I use SELECTEDMEASURE twice in the one calculation item.
Has anyone else come across this issue or have an suggestions to fix it?
Thank you.
Thanks @amitchandak, I have a measure to assess the current priority and the condiitonal formatting is based on that. For Priority 1, the cell fill shoule be red, for priority 2-4 it should be yellow and then for priority 5-7 it should be green. So the conditional formatting is working for the calculation items 'Created' and 'KPI Pass', but not for the 'KPI Pass %'.
The only difference I can see between the calc items is that the one the conditional formatting is not working for references SELECTEDMEASURE twice. The calculation itself is working correctly, just not the conditional formatting.
Just to follow on from @amitchandak's point around calculation groups and conditional formatting. There are some good sources online about how to use calculation groups with condtional formatting. I've added a link from well renowed Alberto Ferrari from SQL BI discussing a method which involves field parameters.
@JessA , I created a calculation group
Divide1 = divide(CALCULATE(SELECTEDMEASURE(), 'Item'[Brand] = "Brand 1"), CALCULATE(SELECTEDMEASURE(), 'Item'[Brand] = "Brand 2"))
and that is working
For conditional formatting, you should consider measure-based conditional formatting
Please let me know what is exactly you wanted to achieve
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
145 | |
73 | |
63 | |
52 | |
51 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |