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!View all the Fabric Data Days sessions on demand. View schedule
How to write a logical if statement for the index
Have written the same calculation in excel and would like to write the same in DAX
IF(C3<>"",C3/$C$3,"")
Sample Data is attached
| Customer ID | Temp | Value | Calculation |
| T02 | 35 | 55 | |
| T03 | 27 | 50 | 100% |
| T06 | 29 | 49 | 98% |
| T01 | 33 | 48 | 96% |
| T04 | 28 | 47 | 94% |
| T05 | 27 | 46 | 92% |
| T01 | 35 | 45 | 90% |
| T02 | 26 | 44 | 88% |
| T03 | 34 | 43 | 86% |
| T01 | 31 | 41 | 82% |
| T05 | 31 | 40 | 80% |
| T01 | 31 | 39 | 78% |
| T02 | 31 | 38 | 76% |
| T06 | 35 | 37 | 74% |
| T04 | 26 | 36 | 72% |
| T05 | 28 | 34 | 68% |
| T02 | 33 | 32 | 64% |
| T01 | 26 | 31 | 62% |
| T03 | 28 | 30 | 60% |
| T02 | 32 | 30 | 60% |
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new column.
Calculation CC =
VAR _fixvalue =
SUMX (
FILTER ( Data, Data[Customer ID] = "T03" && Data[Temp] = 27 ),
Data[Value]
)
VAR _result =
DIVIDE ( Data[Value], _fixvalue )
RETURN
IF ( _result > 1, BLANK (), FORMAT ( _result, "#0.0%" ) )
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new column.
Calculation CC =
VAR _fixvalue =
SUMX (
FILTER ( Data, Data[Customer ID] = "T03" && Data[Temp] = 27 ),
Data[Value]
)
VAR _result =
DIVIDE ( Data[Value], _fixvalue )
RETURN
IF ( _result > 1, BLANK (), FORMAT ( _result, "#0.0%" ) )
Thank you
I am getting the result in text format not able to change and only 100% is getting displayed here.
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!