Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
So I'm having trouble getting the resulting DAX Measure return as a Text data type. For some reason it defaults to a Whole Number.
Matrix Background Color =
VAR MaxVal = MAX(Matrix_Desc[Grouping Order])
VAR ColorToReturn = IF(MaxVal==1,"#000000","#FFFFFF")
RETURN IFERROR(ColorToReturn,"#000000")
Screenshot:
Screenshot:
For some reason using a conditional statement in the IF part of the DAX leads to different result data types??
Solved! Go to Solution.
I was able to resolve this by changing the "Grouping Order" column that I was taking the MAX from. Apparently this value was a Text value, which was probably leading to an error when taking the MAX and comparing it to a whole number. Changing this column to a a Whole Number ensured that I was able to use the measure as a variable in conditional formatting to set the color.
I was able to resolve this by changing the "Grouping Order" column that I was taking the MAX from. Apparently this value was a Text value, which was probably leading to an error when taking the MAX and comparing it to a whole number. Changing this column to a a Whole Number ensured that I was able to use the measure as a variable in conditional formatting to set the color.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!