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
learner4eva
Helper I
Helper I

Need Help! Creating multiple DAX measures

Hi ! Really appreciate your help in this.. Have been stuck for 3 days.. 

 

TableA: 100,000 rows

VersionPartNoRefNoTypePartQty
V1A1233532-421X5
V1B2345754-643Y3
V2C3424362-346X2
V2A3526853-435Z6

 

TableB: 200,000 rows

SupportingPartNoRefNoPeriodRefQty
P0043532-421M1100
P0056853-435M1200
P0046853-435M250
P0064362-346M3400

 

I would like to create a measure UseQty.

UseQty = RefQty * PartQty when RefNo (in Table B)= RefNo (in Table A)

Eventually I would like to create charts using Period (Table B), PartNo (Table A), Type(Table A) and UseQty (Measure) for a given Version.

 

I tried creating an additional column in Table B via PowerQuery but that ended up making the calculation very slow as I have 100k rows in Table A and 200k rows in Table B. 

 

I tried creating a table measure and I ended up having 3Million rows

UseQty = GENERATEALL(
TableA,
var Ref = A[RefNo]
RETURN
SELECTCOLUMNS(CALCULATETABLE(TableB, TableB[RefNo]=Ref),"PartNo",TableB[SupportingPartNo],"AttachRate",TableB[RefQty], "RequiredQty", TableB[RefQty]*TableA[PartQty])
)

 

Is there a way to create measures instead of tables?

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @learner4eva ;

You could try to create a measure  as follows:

Measure = 
CALCULATE( MAX('TableA'[PartQty]),FILTER('TableA',[RefNo]=MAX('TableB'[RefNo])))*MAX('TableB'[RefQty])

The final output is shown below:

vyalanwumsft_0-1634717420472.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @learner4eva ;

You could try to create a measure  as follows:

Measure = 
CALCULATE( MAX('TableA'[PartQty]),FILTER('TableA',[RefNo]=MAX('TableB'[RefNo])))*MAX('TableB'[RefQty])

The final output is shown below:

vyalanwumsft_0-1634717420472.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@learner4eva , You need to create a common dimension refno

 

RefNo = distinct(Union(all(Table[RefNo]) ,all(Table[RefNo]) )) //or use distinct in place of all

 

example

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

 

Then create a measure like

sumx(Values(RefNo[RefNo]) , calculate( sum(RefQty]) * sum(PartQty) ) )

 

 

if you want a new column way

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

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

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.