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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Saranya_Tamil
Frequent Visitor

Need help in DAX

I need to figure out whether the Deal is a S4U or not. The logic is if other than S4U in 'Name' field has S4U as family then it is a S4U deal. For ex, here 1 is not S4U bcz other than S4U no one has S4U as family and  2 is S4U deal because ERP in this has S4U family. I don’t know how to achieve this in power BI using DAX.

DealNameFamilyOutput
1ERPERPNo
1S4US4UNo
1ERPMSNo
1ERPPSNo
2ERPERPYes
2S4US4UYes
2ERPS4UYes
2ERPPSYes

 

Need the output as mentioned

1 ACCEPTED SOLUTION

@Saranya_Tamil ,

Add this as a second Calculated Column:

Output = SWITCH(
             TRUE(),
             CALCULATE( SUM([S4UDeal] ),
                  ALLEXCEPT( 'Deals (2)', 'Deals (2)'[Deal] )) > 0, "Yes",
                  "No" )

rsbin_0-1668534240884.png

If you want, you can probably combine both into just one column.

Regards,

View solution in original post

5 REPLIES 5
rsbin
Super User
Super User

@Saranya_Tamil ,

Please try this as a Calculated Column:

S4UDeal = IF( AND( [Name] <> "S4U", [Family] = "S4U" ), "Yes", "No" )

rsbin_0-1668532542004.png

Trust this will work for you.

Regards,

Many thanks, but I need the output as below

DealNameFamilyOutput
1ERPERPNo
1S4US4UNo
1ERPMSNo
1ERPPSNo
2ERPERPYes
2S4US4UYes
2ERPS4UYes
2ERPPSYes

@Saranya_Tamil ,

Add this as a second Calculated Column:

Output = SWITCH(
             TRUE(),
             CALCULATE( SUM([S4UDeal] ),
                  ALLEXCEPT( 'Deals (2)', 'Deals (2)'[Deal] )) > 0, "Yes",
                  "No" )

rsbin_0-1668534240884.png

If you want, you can probably combine both into just one column.

Regards,

Thank you @rsbin , it works 🙂

Ttaylor9870
Helper III
Helper III

Hi @Saranya_Tamil ,

 

You need to create a new calculated column and this should hopefully do the job...

 

S4U Deal = IF('Table'[Name] = "S4U",'Table'[Family],'Table'[Name])
 
'Table' in the DAX is the name of your Table, let me know if this worked or not. 😊
 
Many Thanks,
 
Taylor
 

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.