Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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%" ) )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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%" ) )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you
I am getting the result in text format not able to change and only 100% is getting displayed here.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |