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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi All
Need help on how to write DAX for the below scenario
i need to create a dax calcultions for calculated columns for below
1.case when Acc Number ='54112' then Amount
2.case whenAcc Number in ('54112','56019','44291','442901') then Amount.
Regards,
Anita
Good Morning, Anita,
You should be able to do this with a Switch(True()) function.
For a calulated column, your code should look something like this. :
Calculated Column =
SWITCH(
TRUE(),
TableName[Acc Number] = "54112", TableName[Amount],
TableName[Acc Number] in {"54112", "56019", "44291", "442901"}, TableName[Amount],
Blank())
The syntax for a measure changes some, so be aware of that. I used TableName as a placeholder for whatever your table is called in your model.
I wasn't sure what your return value was for anything outside the parameters so I put a blank() to make it easy.
Hopefully this helps!
Thanks,
JTB
You can use a Switch statement to achieve this.
When to use Switch Statement instead of IF Statement in PowerBI | MiTutorials - YouTube
Hi,
could you please let me know the dax logic how to write it.
Regards,
Anita
Please see the video below.
When to use Switch Statement instead of IF Statement in PowerBI | MiTutorials - YouTube
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.