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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
cristianml
Post Prodigy
Post Prodigy

Format number color with dax

Hi,

 

I want to format number and color with dax. It works with "0,,M" but also I want to change the color.  Could you help me to fix the following ?

 

VAR VAR1 = "Revenue Actual:" & FORMAT([Actual Revenue], "0,,M" & "#00d600")

 

cristianml_0-1648841456957.png

 

Thanks

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @cristianml 

 

Formatting numbers and setting colors need to be separated into two Dax. I briefly simulated some data hoping it would fit your situation.

Measure1:

VAR VAR1 = "Revenue Actual:" & FORMAT([Actual Revenue], "0,,M")

Measure2:

Color = 
IF([VAR VAR1]="Revenue Actual:" & FORMAT([Actual Revenue], "0,,M"),"#00d600")

Then select the field to which you want to apply the color. Select the font color in conditional formatting.

vzhangti_0-1649146544290.pngvzhangti_1-1649146562331.pngvzhangti_2-1649146606319.png

The color needs to be set separately with Measure.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @cristianml 

 

Formatting numbers and setting colors need to be separated into two Dax. I briefly simulated some data hoping it would fit your situation.

Measure1:

VAR VAR1 = "Revenue Actual:" & FORMAT([Actual Revenue], "0,,M")

Measure2:

Color = 
IF([VAR VAR1]="Revenue Actual:" & FORMAT([Actual Revenue], "0,,M"),"#00d600")

Then select the field to which you want to apply the color. Select the font color in conditional formatting.

vzhangti_0-1649146544290.pngvzhangti_1-1649146562331.pngvzhangti_2-1649146606319.png

The color needs to be set separately with Measure.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

MattAllington
Community Champion
Community Champion

Read my article here https://exceleratorbi.com.au/conditional-formatting-with-a-text-field-in-power-bi/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.