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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
CierrahW
Regular Visitor

If Then Formula

How would you write a formula for a new column that only populates the value from the "YTD-2020M06-Installation Jobs" column if the value in the "Booked vs Actual" column is "Total Booking" AND the value in the "Sell Price/Earned Revenue & Gross Margin/Gross Profit" column is "Gross Margin/Gross Profit"? 

 

 

CierrahW_0-1597700631101.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@CierrahW ,

In M - edit Query

if [Booked vs Actual] = "Total Booking" and [Sell Price/Earned Revenue & Gross Margin/Gross Profit] = "Gross Margin/Gross Profit" then [YTD-2020M06-Installation Jobs]

if [Booked vs Actual] = "Total Booking" && [Sell Price/Earned Revenue & Gross Margin/Gross Profit] = "Gross Margin/Gross Profit" then [YTD-2020M06-Installation Jobs]

 

In Dax,  new Column

if ([Booked vs Actual] = "Total Booking" && [Sell Price/Earned Revenue & Gross Margin/Gross Profit] = "Gross Margin/Gross Profit" , [YTD-2020M06-Installation Jobs] , blank() )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
vivran22
Community Champion
Community Champion

Hello @CierrahW 

 

Use the following DAX as calculated column:

 

Output = 
IF(
  [Booked vs Actutal] = "Total Booking"
   && [Sell Price/Earned Revenue & Gross Margin/Gorss Profit] = "Gross Margin/Gross Profit",
      [YTD-2020M06-Installation Jobs]
)

 

Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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