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
TheJaks
New Member

DAX question - SUMX from multiple tables

Hi all, 

 

Quite new to PowerbI & DAX but have done a course and making good progress. Just stuck on 1 component, where I'd like to calculate a SUMX, based on 2 tables (each of which are removed a few steps via other tables), grouped by another relate table... Unsure how to do approach this in DAX... Suspect it may need ADDCOLUMNS or nested summarize but not very familiar with that.

 

I have a relatively complex database, overview here:Screenshot 2022-10-30 124425.png

In simple terms I'd like to show what I think is a SUMX (ie row level is important) made up of a field from the policy table (lELR) , multplied by a field in the BDX table (%_covered), grouped by the Carrier name in table Binder. 

 in SQL/Access I did it relativly easily with a query builder. Just a bit of at a loss how to in DAX!

 

Any tips which way to go with this would be appreciated.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @TheJaks 

I would guess the following 

=
SUMX (
    SUMMARIZE (
        Payments,
        Policies[Policy ID],
        BDX[BDX],
        "@lELR", SUM ( Policies[lELR] ),
        "@covered", SUM ( BDX[%_covered] )
    ),
    [@lELR] * [@covered]
)

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @TheJaks 

I would guess the following 

=
SUMX (
    SUMMARIZE (
        Payments,
        Policies[Policy ID],
        BDX[BDX],
        "@lELR", SUM ( Policies[lELR] ),
        "@covered", SUM ( BDX[%_covered] )
    ),
    [@lELR] * [@covered]
)

Abosolute legend. Worked a charm. Brilliant and thanks ever so much!!

Jihwan_Kim
Super User
Super User

Hi,

I think RELATED DAX function inside SUMX might help.

 

https://dax.guide/related/

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.

Top Solution Authors