The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a measure table with 3 measures-> sales, revenue %, profit %.
I want to show these measures dynamically in a single text box.
The requirement is if sales > 0 return font in green color, if sales <0 return font in red color, if sales between 0 to -500 show in amber color.
If revenue % is > or equal to 90% show font in green color, else show in red color.
if profit % <0 then red , if >0 then green font.
How can I write DAX for above requirement
My text box would be like -
example 1 - sales for xyz is -200, revenue% is 40% , profit % is -20% [when date slicer is selected for -April]
example 2 - sales for xyz is 500, revenue% is 90% , profit % is 40% [when date slicer is selected for -March]
basically the numbers inside text box are dynamic values which will change based on my selections in a date slicer.
Thankyou for your help in advance 🙂
Solved! Go to Solution.
@Sania-F Follow the following steps which I have already done in my use and its worked:
Add a Date Slicer:
Display the Combined Text:
This setup will demonstrate how the text dynamically updates with different font colors based on the conditions you specified.
If this works. Please marked as a solution done.😊
@Sania-F Follow the following steps which I have already done in my use and its worked:
Add a Date Slicer:
Display the Combined Text:
This setup will demonstrate how the text dynamically updates with different font colors based on the conditions you specified.
If this works. Please marked as a solution done.😊
@Sania-F ,
You can't conditionally format some words inside a Power BI text box. You will require grouping of 3 text boxes and 3 card visuals (one each for sales, revenue and profit) and manually adjustments so that they seem like a single text line.
You can then conditionally format the callout value of card visuals individually using Rules to achieve required color. You won't even require DAX for it.
Here is a snap to understand the conditional formatting: