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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
HI Team,
I need support. I have two dax queries one is A other is B. I need another dax query C in which logic should be like i have one column named as remark. So query should be like C =if(remark == AA give me A, remark == BB, B). But i am unable to use If condition with a column in dax query. Is there any other way, i tried switch true as well but after using it i am giving selected value as well due to which i need to select AA or BB or both in the slicer. If i am selecting both then only numbers are showing correct. Can anyone help me in this, it's urgent. Thanks in advance.
My query -
Hi @Anonymous ,
I created some data:
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
DISTINCT('Table'[Remake])
2. Create measure.
Test =
var _select=SELECTCOLUMNS('Table 2',"select",[Remake])
var _count=COUNTX(ALLSELECTED('Table 2'),[Remake])
return
SWITCH(
TRUE(),
"AA" in _select && _count =1,[MeasureA],
"BB" in _select && _count =1,[MeasureB],
"AA" in _select && "BB" in _select && _count=2,1
)
3. Result:
Select“AA”:
Select”BB”:
Select“AA”&&”BB”:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Bro, Thanks for your time. I tried your approach but it's giving me the same number for all the countries even after establishing the relationship as well between the tables. I did some changes in the query and cross checking the numbers let's see if that would be correct then i'll post it here as well. But thanks for your effort and time. Really appreciating.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!