Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello everyone!!!
I am performing the following measurement in dax:
CALCULATION =
VAR OPERATION = calculate(
SUM(Table1[amount]),
Table1[black/white]="white"
)
VAR OPERACION2 = calculate(
sum(Tabla1[monto2]),
Tabla1[blanco/negro]="blanco"
)
TOTAL VAR = DIVIDE(operation,operation2,0)
RETURN
TOTAL
What I need is that when the field [black/white] = "black" puts as a value "NC" otherwise do the calculation I wrote at the beginning. Try to put an if or switch but I do not know how to make it read the value of the column.
Can you help me? Thank you.
Thanks for the reply and suppose I put Blank, as I do??? that's what I need to know how to put the if within the measure I wrote. Thank you.
CALCULATION =
if(Table1[black/white]="black","NC",
format(divide(SUM(Table1[amount]),sum(Table1[amount2])),"#.#%"))
or (for blank)
CALCULATION =
if(Table1[black/white]="white",
divide(SUM(Table1[amount]),sum(Table1[amount2])),"#.#%")
This may or may not work depending on your setup. Provide sample data if you want more assistance.
You cannot return a text string or a number in the same measure. All results need to be of the same type (or BLANK). Change your measure to return BLANK instead of NC, or convert all output to text.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.