Forum Discussion
llm
4 years agoFrequent Visitor
SQL Case Statement to Dax
Hi In the instructions it says not to ask about SQL conversions but I'm willing to take a chance that someone can help . I am a beginner with Power Bi & Dax and having difficulty converting the follo...
- 4 years ago
I would look at using SWITCH but in the form
SWITCH (
True,
Case1, Outcome1,
Case2, Outcome2
....
)
See the example in https://dax.guide/switch/
bcdobbs
Community Champion
4 years agoI would look at using SWITCH but in the form
SWITCH (
True,
Case1, Outcome1,
Case2, Outcome2
....
)
See the example in https://dax.guide/switch/
llm
4 years agoFrequent Visitor
This worked
CurrRetain = SWITCH(TRUE,
IF (ISBLANK(APTD[PayCategory]),RELATED(APCO[RetPayType]),RELATED(APPC[RetPayType])) &&
(ISBLANK(APTD[PaidDate])) || ((APTD[PaidDate]) > TODAY()) &&
(RELATED(APTH[InvDate]) <= TODAY()),
APTD[Amount],
0
)