Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello
I have a table that I want to be dynamic with time intelligence. I have therefore made a calculation group called time intelligence which allows users to switch between timeframes for all the metrics. I then wanted the format of these metrics to change depending on the timeframe because the numbers get a lot bigger / smaller depending on the timeframe selected. The final piece of formatting I want to show is a certain colour depending on the value of the metrics (i.e. if it is below target then 'red').
The problem I am facing is when I combine all these things together Power BI gives me an error saying I can't work with my number formatting and colour formatting at the same time. The error message says: 'Cannot convert value 'Red' of type Text to type Numeric'
The DAX code for my number formatting is the following:
IF ( OR ( CONTAINSSTRING ( SELECTEDMEASURENAME (), "*%*" ), CONTAINSSTRING ( SELECTEDMEASURENAME (), "CR*" ) ), FORMAT ( SELECTEDMEASURE (), "0%" ), FORMAT ( SELECTEDMEASURE () / 1000, "£#,0K" ) )
The DAX code for my conditional formatting is the following (I would like to change this to be dynamic using something like SELECTEDMEASURE () instead of selecting the individual measure but this doesn't seem to work) :
IF([Demand Sales vs BGT] < 0, "Red", BLANK())
Any help would be v gratefully received!
Solved! Go to Solution.
@tloup Can't seem to replicate this. Is the dynamic format for the measure [Demand Sales vs BGT]? Only thing I don't have is the calculation group involved. Any chance you can share a PBIX?
Did the above get resolved? I am trying to do something similar to format certain timeintelligence values of all SELECTEDMEASURE to have colours based on their values.
Is there a solution to this please?
@tloup Can't seem to replicate this. Is the dynamic format for the measure [Demand Sales vs BGT]? Only thing I don't have is the calculation group involved. Any chance you can share a PBIX?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
9 |