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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mohammedmahadik
Frequent Visitor

How to use CALCULATE SUM ALL with related columns

I have two tables in PowerBI. SOV_SOT has Values, Brand, Date. The other BRAND_Master has Brand_O/P and Brand_SOV. I have created a relation between columns "Brand" from SOV_SOT table and column "BRAND_SOV" in the BRAND_Master table.
It is a Many to One relationship. I use the BRAND_O/P to create a slicer to select brand. I want to have a calculate sum formula such that it has an all filter. but the selection should be basis BRAND_O/P

The following formula doesn't work and if I change ALL argument to SOV_SOT[BRAND], it doesn't give me the required result.
 
Calc_SOT =
    CALCULATE(
    SUM(SOV_SOT[TOTAL TIME IN MIN(Sum)]),
    ALL(BRAND_Master[BRAND_O/P])
    )
1 ACCEPTED SOLUTION

Thank you all who helped.

I figured it our eventually.

Calc_SOT = CALCULATE( SUM(SOV_SOT[TOTAL TIME IN MIN(Sum)]), ALL(SOV_SOT[BRAND]), REMOVEFILTERS(BRAND_MASTER[BRAND_O/P]))

View solution in original post

4 REPLIES 4
v-xinruzhu-msft
Community Support
Community Support

Hi @mohammedmahadik 

Try the following measure.

Calc_SOT =
IF (
    CALCULATE ( SUM ( SOV_SOT[TOTAL TIME IN MIN(Sum)] ) ) <> BLANK (),
    CALCULATE ( SUM ( SOV_SOT[TOTAL TIME IN MIN(Sum)] ), ALLSELECTED ( SOV_SOT ) )
)

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you all who helped.

I figured it our eventually.

Calc_SOT = CALCULATE( SUM(SOV_SOT[TOTAL TIME IN MIN(Sum)]), ALL(SOV_SOT[BRAND]), REMOVEFILTERS(BRAND_MASTER[BRAND_O/P]))

amitchandak
Super User
Super User

@mohammedmahadik , You need all, if you want ignore the filter. FIlter should work on measure like

 

Calc_SOT = SUM(SOV_SOT[TOTAL TIME IN MIN(Sum)])

 

Or use allselcetd

Calc_SOT =
CALCULATE(
SUM(SOV_SOT[TOTAL TIME IN MIN(Sum)]),
ALLSELECTED(BRAND_Master)
)

 

 

or

 

Calc_SOT =
CALCULATE(
SUM(SOV_SOT[TOTAL TIME IN MIN(Sum)]),
ALLSELECTED(BRAND_Master),
VALUES(BRAND_Master[BRAND_SOV])
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hey Amit,

 

It didn't work.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.