Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Conditional Check DAX for Indicator

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

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Then you need to create a new dimension table and a mapping table. Something along the lines of this: 

SS1
NS0
AS1
AS0

Dimension table

1
0

Mapping table

Should look like this:
image.png


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. 


Connect on LinkedIn

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

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" ) )
)

 

Anonymous
Not applicable

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

tex628
Community Champion
Community Champion

Then you need to create a new dimension table and a mapping table. Something along the lines of this: 

SS1
NS0
AS1
AS0

Dimension table

1
0

Mapping table

Should look like this:
image.png


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. 


Connect on LinkedIn
Anonymous
Not applicable

Thanks for the reply @AlB 

 

yeah, it'll never go to the last option. But we need that last option to be considered somehow.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.