March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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 @rastoiyashu4 ,
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |