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

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

Reply
MNLegoman
Frequent Visitor

Calculation using measure from one table/matrix and subtotal from another.

How would I go about calculating "Unique REJ" divided by subtotal of "Count of Obj Type" (aka "Total) for each person by year given that this data is from 2 different matrices each a separate table?

 

 

2 tables.png

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Since you have a M:M relationship between the Created By columns in your two tables, you could make a bridge table of unique CreatedBy values to make 1:M relationships to both tables.  Or, with no relationship between the tables you can use this measure in a table visual with the Created By column from your TaskDetails table.

 

NewMeasure =
VAR vREJ = [Unique REJ]
VAR vTotalObjects =
    CALCULATE (
        COUNT ( CFECODetails[Obj Type] ),
        TREATAS (
            VALUES ( CFTaskDetails[Created by] ),
            CFECODetails[Created by]
        )
    )
RETURN
    DIVIDE (
        vREJ,
        vTotalObjects
    )

 

If you are going to do a lot more with this model, you should consider making the bridge table to make your future analyses/visualizations easier.  There are lots of articles/videos on making bridge tables out there.

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

Since you have a M:M relationship between the Created By columns in your two tables, you could make a bridge table of unique CreatedBy values to make 1:M relationships to both tables.  Or, with no relationship between the tables you can use this measure in a table visual with the Created By column from your TaskDetails table.

 

NewMeasure =
VAR vREJ = [Unique REJ]
VAR vTotalObjects =
    CALCULATE (
        COUNT ( CFECODetails[Obj Type] ),
        TREATAS (
            VALUES ( CFTaskDetails[Created by] ),
            CFECODetails[Created by]
        )
    )
RETURN
    DIVIDE (
        vREJ,
        vTotalObjects
    )

 

If you are going to do a lot more with this model, you should consider making the bridge table to make your future analyses/visualizations easier.  There are lots of articles/videos on making bridge tables out there.

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you Pat! Your measure worked perfectly. I'll also take a look at the bridge table idea. That might prove useful at a later date.

amitchandak
Super User
Super User

@MNLegoman , can share the measure formula

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Hope this is good. I had to cut the data way back, but I think there is still enough there to work with.

 

(link removed)

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.