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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.