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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
raionpbi
Frequent Visitor

Dynamic Calculation Contexts based on respective column

Hi,

I'd like to calculate totals within L1 in the table where only L2 is available (2nd table to present 8 and 15 for a1,a2,a3 and b1,b2,b3 respectively instead of total of 23). Thus the calculation must know the context, that for eg. 'a1' 'a' is the base.

Capture.PNG

I currently use:

  • Total L1 = CALCULATE(sum(Tab1[value]); all(Tab1[L2]))
  • Total = CALCULATE(sum(Tab1[value]); all(Tab1[L1];Tab1[L2])

Any help appreciated.

Thank you.

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @raionpbi

 

You may refer to below measure:

Total L1 =
CALCULATE ( SUM ( Tab1[value] ), ALL ( Tab1 ), VALUES ( Tab1[L1] ) )

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
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

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @raionpbi

 

You may refer to below measure:

Total L1 =
CALCULATE ( SUM ( Tab1[value] ), ALL ( Tab1 ), VALUES ( Tab1[L1] ) )

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.