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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Afiq_Danial
Helper II
Helper II

Conditional Statement

Hi, 

Does anyone knows of a function to solve this problem? I want to write a conditional statement with DAX.

The problem is  "if there are more than 2 number "5", then ..."

Would appreciate if you guys help me, Thanks!

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @Afiq_Danial ,

you can create this calculated column:

More than 2 "5" = IF('Facts36'[Value1] =5 &&'Facts36'[Value2]=5 && 'Facts36'[Value3] =5,
            "Yes")
and then you can filter the table for "Yes"
mangaus1111_0-1666644505242.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
mangaus1111
Solution Sage
Solution Sage

Hi @Afiq_Danial ,

you can create this calculated column:

More than 2 "5" = IF('Facts36'[Value1] =5 &&'Facts36'[Value2]=5 && 'Facts36'[Value3] =5,
            "Yes")
and then you can filter the table for "Yes"
mangaus1111_0-1666644505242.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mangaus1111
Solution Sage
Solution Sage

Is your table like table A or Table B? Which is your expexted result?

mangaus1111_0-1666642118148.png

 

I have table A just like u created. I want to transform my table A to 

Afiq_Danial_0-1666642344315.png

I only want to display names who has the value "5" more than twice.

mangaus1111
Solution Sage
Solution Sage

Hi @Afiq_Danial ,

 

what do you mean by more than 2 numbers?

Something like this

mangaus1111_0-1666641541564.png

 

James555
Lucas331

 

For example, James' row has the value "5" more than 2. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors