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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Jonjon_99
Helper I
Helper I

POWER BI DAX IF STATEMENT

hi, i would like to create new column/DAX formula that will return my Product to "Others".

this is the sample

if the product = Montana, Paseo, Velo and VTT it will be tag as Others

Jonjon_99_2-1701392634643.png

TIA!
@johnyip 

 

 

 

 

 

1 ACCEPTED SOLUTION

then it’s better for you to create a table with the names of the products in an Excel file and upload it to power bi
and then you can update the list at any time
----

Measure = IF(MAX('yourtabl[product]) in VALUES('tablePro[Product]), "Others", MAX('yourtabl[product]))

View solution in original post

4 REPLIES 4
Ahmedx
Super User
Super User

pls try this

Measure = IF(MAX('yourtabl[product]) in {Montana, Paseo, Velo, VTT}, "Others", MAX('yourtabl[product]))
----- 
Column = IF('yourtabl[product] in {Montana, Paseo, Velo, VTT}, "Others", 'yourtabl[product])

thanks for this @Ahmedx , what if my product ID is more than 100 lines that i need to tag as "Others", what is the best measure to use? 🙂

then it’s better for you to create a table with the names of the products in an Excel file and upload it to power bi
and then you can update the list at any time
----

Measure = IF(MAX('yourtabl[product]) in VALUES('tablePro[Product]), "Others", MAX('yourtabl[product]))

will check it. thanks!

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.