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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
cgpahnk
Frequent Visitor

Measurement Calculations using Data from Two Different Tables & Model View Connection?

Hi,

 

I'm struggling to connect my data from two different tables for my measurement.

 

Below I'll paste the measurement I created to try and calculate the rate "events" per unit delivered:
 
My data comes froms two separate sources, so two different tables, and I tried to make a Many:Many connection in the Model View so I identify the rate of events for every supplier.
 
Count of EventID divided by Delivery Quantity =
CALCULATE(
DIVIDE(
    COUNTA('Event Severity'[EventID]),
    SUM('SDP 2020-2023'[Delivery Quantity])),
FILTER(CROSSJOIN(ALL('SDP 2020-2023'[Supplier Name]),ALL('Event Severity'[Supplier Name])),
'SDP 2020-2023'[Supplier Name]='Event Severity Consolidated'[Supplier Name]))
 
This is what happens when I place the measurement on a visual (I hid my supplier names):
cgpahnk_0-1705956725668.png

Can anyone help me with this?

9 REPLIES 9
gadielsolis
Resolver III
Resolver III

Please try the following DAX:

 

Events vs Amount =
    VAR _Events= COUNTROWS(Events)
    VAR _Amount=SUM(Amounts[Amount Delivered])
    VAR _Events_vs_Amount=DIVIDE(_Amount,_Events)
    RETURN
    _Events_vs_Amount

gadielsolis_0-1705961016099.png

Worth to mentioning, I did not change the relationship therefore still using many to many relationship.

I'm trying to get a percentage though, so basically

Events per Supplier/Amount per Supplier

Sorry,

 

I'm not getting what you need, if you divide events per supplier by amount delivered this would give you a really low number

 

gadielsolis_0-1705963085746.png

 

If you can put this in excel and show me the desired output I will be more than happy to help.

Yes, my bad I should have clarified! The numbers should be low very low, and PowerBI will show these numbers with scientific notation, but with my calculation it showed all suppliers as having the same percentage.

Ohhh, I understand.

 

You can try the following measure:

 

Events vs Amount =
    VAR _Events= COUNTROWS(Events)
    VAR _Amount=SUM(Amounts[Amount Delivered])
    VAR _Events_vs_Amount=DIVIDE(_Events,_Amount)
    RETURN
    _Events_vs_Amount

gadielsolis_0-1705963858879.png

 

Okay I was able to get that calculation to work, but whenever I go to filter by the supplier name it stops working. I think theres an issue with my model view connections.

 

I actually created a table with all of the Supplier Names with no duplicates and it still wants to create a Many:Many relationship

For example, if I took the amount of events I had (15) and divided it the total amount delivered*100 I'd get a percentage, what I want to figure out is how to display this percentage for each unique supplier.

gadielsolis
Resolver III
Resolver III

Hello,

 

Not sure if I understand correctly,

 

My advice would be creating a separate table with the name of the suppliers and connect it to the fact tables to generate one to many relationships. 

If you could share a dummy file with some examples it would be great for a better understanding.

Let me try creating a new table with the supplier names, but this is basically what my data looks like:

 

My "Amount Delivered" data is basically Units/Lbs, so what I'm trying to do is figure out how many Events happen per Unit/Lb (Amount Delivered)

 

EventIDSupplier Name
1Supplier A
2Supplier A
3Supplier A
4Supplier B
5Supplier B
6Supplier B
7Supplier B
8Supplier B
9Supplier B
10Supplier C
11Supplier C
12Supplier D
13Supplier D
14Supplier D
15Supplier D

 

Amount DeliveredSupplier Name
1551431Supplier A
143454Supplier A
16786Supplier A
34Supplier B
65342Supplier B
32677Supplier C
57777Supplier C
32111Supplier C
567788Supplier D
22223Supplier D
4456Supplier D

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.