Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
We're trying to create a column using the below condition. But, it's not working for us as expected.
I'm having a column Indicator with values 1 and 0
I need to write the below condition using DAX.
If Indicator = 1 THEN "SS" ELSE IF
Indicator = 0 THEN "NS" ELSE IF
Indicator = 1 or Indicator = 0 THEN "AS"
I have tried the below DAX, but it's not working for me.
IF(Indicator =1 , "SS", IF(OR(Indicator=1,Indicator=0),"AS","NS"))
Could someone please help me here.
Thanking in Advance.
Regards,
Jesh
Solved! Go to Solution.
Then you need to create a new dimension table and a mapping table. Something along the lines of this:
SS | 1 |
NS | 0 |
AS | 1 |
AS | 0 |
Dimension table
1 |
0 |
Mapping table
Should look like this:
Then create a slicer on your locations in the dimension table. The filter will move through the mapping table and then filter you main table accordingly.
Hi @Anonymous
It would be this literally. Do note though that it does not make much sense as it is, since it will never get to the last option (If Indicator is 1 or 0 it will have been assigned already "SS" or "NS").
Col = IF ( Indicator = 1, "SS", IF ( Indicator = 0, "NS", IF ( OR ( Indicator = 1, Indicator = 0 ), "AS" ) ) )
My Scenario is to achieve something below.
My dataset is having the below fields.
Location, Indicator
1, 1
2, 1
3, 0
4, 0
So, after creating the below mentioned DAX.
When I click on SS, it should show me locations 1 and 2.
When I click on NS, it should show me locations 3 and 4.
When I click on AS, it should show me all the locations.
Thanks,
Jesh
Then you need to create a new dimension table and a mapping table. Something along the lines of this:
SS | 1 |
NS | 0 |
AS | 1 |
AS | 0 |
Dimension table
1 |
0 |
Mapping table
Should look like this:
Then create a slicer on your locations in the dimension table. The filter will move through the mapping table and then filter you main table accordingly.
Thanks for the reply @AlB
yeah, it'll never go to the last option. But we need that last option to be considered somehow.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |