Forum Discussion
jak8282
3 years agoHelper III
Calculated column not working
Hi, For some reason my calculated column is no working - all values are a decimal number. DAX is TestRange70to79.9 =
IF(
AND(
[Supplier Percentage Conv] >= 'Time Penalty'[Left...
jak8282
3 years agoHelper III
Hi Dhairya ,
Sure,
Time Penalty
| Percentage | Penalty |
| 90- 97.9 | 10% |
| 80- 89.9 | 20% |
| 70 - 79.9 | 30% |
| 60- 69.9 | 40% |
| <60 | 50% |
Calculated Columns
DashPosition = SEARCH("-", TRIM('Time Penalty'[Percentage]), 1, BLANK())
LessThanPosition = SEARCH("<", TRIM('Time Penalty'[Percentage]), 1, BLANK())
LeftValue =
IF(
NOT ISBLANK('Time Penalty'[DashPosition]),
VALUE(TRIM(LEFT('Time Penalty'[Percentage], 'Time Penalty'[DashPosition] - 1))),
BLANK()
)
right position = IF(
NOT ISBLANK('Time Penalty'[DashPosition]),
VALUE(TRIM(MID('Time Penalty'[Percentage], 'Time Penalty'[DashPosition] + 1, LEN('Time Penalty'[Percentage]) - 'Time Penalty'[DashPosition]))),
IF(
NOT ISBLANK('Time Penalty'[LessThanPosition]),
VALUE(TRIM(MID('Time Penalty'[Percentage], 'Time Penalty'[LessThanPosition] + 1, LEN('Time Penalty'[Percentage]) - 'Time Penalty'[LessThanPosition]))),
BLANK()
)
)
TestRange70to79.9 =
IF(
[Supplier Percentage Conv] >= 'Time Penalty'[LeftValue] &&
[Supplier Percentage Conv] <= 'Time Penalty'[right position],
"Yes",
"No"
)
and the measure
[Supplier Percentage Conv] = 77.16
- Dhairya3 years agoSolution Supplier
I tried your code it is giving perfect output.
- jak82823 years agoHelper III
Hi Dhairya ,
Thats interesting - I hardcoded the 77.16
In the PBI it is using
Supplier Percentage Conv = [Supplier Percentage]*100which usesSupplier Percentage = divide([WFM - Supplier Working Time],[WFM - Supplier Scheduled Time])- Dhairya3 years agoSolution Supplier
Though it is hard-coded, I think it should work with measures also.
and instead of creating this measure Supplier Percentage Conv = [Supplier Percentage]*100
you can format your previous measure as a percentage