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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
webportal
Impactful Individual
Impactful Individual

CALCULATE measure in calculated table

This works perfectly if TableB is a physical table:
 
Measure=
CALCULATE([Measure], TableA[ID] IN VALUES(TableB[ID]))
 
But, how to calculate the same measure in an intermediate table?
 
Measure=
VAR Tab = FILTER(...)
RETURN
CALCULATE([Measure], TableA[ID] IN VALUES(Tab[ID]))
 
This doesn't work!
1 ACCEPTED SOLUTION

Sorry. It shouldn't be Tab[ID]. Use the name of the table you're filtering.

 

Measure2 =

VAR Tab = CALCULATETABLE ( VALUES ( TableX[ID] ), FILTER(TableX, ...) )
RETURN
CALCULATE ( [Measure1], TableA[ID] IN Tab )

View solution in original post

3 REPLIES 3
webportal
Impactful Individual
Impactful Individual

@AlexisOlson  thanks, but VAR Tab, doesn't let me use Tab itself as an argument of VALUES.

Sorry. It shouldn't be Tab[ID]. Use the name of the table you're filtering.

 

Measure2 =

VAR Tab = CALCULATETABLE ( VALUES ( TableX[ID] ), FILTER(TableX, ...) )
RETURN
CALCULATE ( [Measure1], TableA[ID] IN Tab )

AlexisOlson
Super User
Super User

I'd try refactoring it slightly.

 

Measure2 =

VAR Tab = CALCULATETABLE ( VALUES ( Tab[ID] ), FILTER(...) )
RETURN
CALCULATE ( [Measure1], TableA[ID] IN Tab )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors