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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.