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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
nmck86
Post Patron
Post Patron

SumIf in Dax

Hi All,

 

I am trying to translate a calculation I created in excel into Power Bi and am running into major issues. I was hoping that someone could take a look at the two attached files and give me some insight on what is going on. The excel file has the results that I am looking for.

 

https://docs.google.com/file/d/1-aXWaQbD_2Fh4ts6w51KhjQ53fWfbMFa/edit?usp=docslist_api&filetype=msex...

 

https://drive.google.com/open?id=1HN8Z1COYbUMyT2rptIkHfWd6RupbvHuN

 

 

1 ACCEPTED SOLUTION

I was able to get the solution! Another user was able to help! I can share the formula if needed. @danextian was able to help out!

View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @nmck86,

 

Please check out the demo here.

I would suggest you use the original data instead of the unpivot data. For example below, filtering out the row in the red rectangle from the unpivot table would be very hard.

Sum_If_in_Dax

Water Quality =
DIVIDE (
    CALCULATE (
        SUM ( 'Result'[Weights] ),
        FILTER (
            'Result',
            'Result'[likeliness to recommend] >= 9
                && 'Result'[water quality] = EARLIER ( Rankings[Value] )
        )
    )
        - CALCULATE (
            SUM ( 'Result'[Weights] ),
            FILTER (
                'Result',
                'Result'[likeliness to recommend] <= 6
                    && 'Result'[water quality] = EARLIER ( Rankings[Value] )
            )
        ),
    CALCULATE (
        SUM ( 'Result'[Weights] ),
        'Result'[water quality] = EARLIER ( Rankings[Value] )
    )
)
Water Prices =
DIVIDE (
    CALCULATE (
        SUM ( 'Result'[Weights] ),
        FILTER (
            'Result',
            'Result'[likeliness to recommend] >= 9
                && 'Result'[water price] = EARLIER ( Rankings[Value] )
        )
    )
        - CALCULATE (
            SUM ( 'Result'[Weights] ),
            FILTER (
                'Result',
                'Result'[likeliness to recommend] <= 6
                    && 'Result'[water price] = EARLIER ( Rankings[Value] )
            )
        ),
    CALCULATE (
        SUM ( 'Result'[Weights] ),
        'Result'[water price] = EARLIER ( Rankings[Value] )
    )
)

Sum_If_in_Dax2

 

Best Regards,

Dale

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

I was able to get the solution! Another user was able to help! I can share the formula if needed. @danextian was able to help out!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.