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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mdp1202
Frequent Visitor

Custom Column IF statement

I can't seem to figure this out, yet it feels so elementary. I have a table in my BI Power Query, and in one column titled "Type" the text values will be one of 3 items: Demand, Supply, or On Hand. I have another column that is a whole number titled "Quantity". I would like to create 3 custom columns, one each for Demand, Supply, and On Hand, where if "Type" = "Demand", then "Quantity", else 0, and so on for the other two. I have this in Excel, just can't figure out the DAX to do it in BI. Sample from Excel below, again I am trying to create conditional columns such as the ones highlighted green in BI. Thanks for your help!

 

mdp1202_0-1659021991578.png

 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use following formulas in DAX for custom columns

Demand = IF([Type]="Demand",[Quantity],0) 
Supply = IF([Type]="Supply",[Quantity],0)
On Hand = IF([Type]="On Hand",[Quantity],0)  

 

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

Use following formulas in DAX for custom columns

Demand = IF([Type]="Demand",[Quantity],0) 
Supply = IF([Type]="Supply",[Quantity],0)
On Hand = IF([Type]="On Hand",[Quantity],0)  

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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