Forum Discussion
Flo95
2 years agoFrequent Visitor
IF Function
Hello everyone, i need a Measure for the following Example: - The "Dunning Level" Column needs to be filled with the measure - If "Dunning Level 1" >= Todays Date --> "Dunning Level" sh...
- 2 years ago
I solved the problem with the following code:
Dunning Level =SWITCH(TRUE(),TODAY() >= [Dunning Level 4], "Level 4",TODAY() >= [Dunning Level 3], "Level 3",TODAY() >= [Dunning Level 2], "Level 2",TODAY() >= [Dunning Level 1], "Level 1","N/A")
az38
2 years agoCommunity Champion
Hi Flo95
I would suggest you need a calculated column, but not a measure
SWITCH(
TRUE(),
[Dunning Level 1] >= TODAY(), "Level 1",
[Dunning Level 2] >= TODAY(), "Level 2",
[Dunning Level 3] >= TODAY(), "Level 3",
[Dunning Level 4] >= TODAY(), "Level 4",
"N/A"
)- Flo952 years agoFrequent Visitor
Hi az38
The columns "Dunning Level 1/2/3/4" were also created by an Measure.
Is it still possible to do a calculated column then?
Im pretty new working with Power BI
Many thanks for your response!
Kind regards,
Florian
- Flo952 years agoFrequent Visitor
Hello az38
I tried it this way now:
But as you can see they all should be in Dunning Level 4, because Today we have 2024 and all of this orders are from 2023.
So it doesnt switch from Dunning Level 1 to Dunning Level 2, Level 3 and Level 4. Do you understand?
Many many thanks again for your help!