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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Remove partial filter context in Calculated column

Hi Folks,

I want to build a data model as shown below:

sankalp_0-1602527813008.png

I want a calculated column "Revenue ignoring country" to show total revenue for each supplier(ignoring country-wise split). 

How can this be achieved. Currently, I am using the DAC formula: 

CALCULATE( Sum(Revenue], ALL( Tablename[Country] ) ).
This formula still gives revenue split countrywide but I want accumulated revenue for each vendor to repeat in rows(where that vendor is present) as shown in the screenshot shared.
Can anyone please help me here?
Thank you
Sankalp
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula (not measure)

=calculate(sum(data[revenue]),filter(data,data[supplier]=earlier(data[supplier])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula (not measure)

=calculate(sum(data[revenue]),filter(data,data[supplier]=earlier(data[supplier])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I have same issue but two different tables. couldnt acheive it though. any help please Re: Adding a calculated colum with different aggre... - Microsoft Fabric Community

Anonymous
Not applicable

@Ashish_Mathur 

Thanks a lot Ashish. This one formula really helps.

 

Regards,

Sankalp

You are welome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try:

CALCULATE( Sum(Tablename[Revenue]), ALLEXCEPT(Tablename, Tablename[Country] ) )

You could use the ALLEXCEPT function instead of the ALL function

 

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

MattAllington
Community Champion
Community Champion

The general problem I believe you are having is that what you have shown is not a data model, it is a table. They are not the same thing. A data model is the collection of tables, relationships and formulas that work together to provide for your reporting needs. This is what you should do

1. Create 3 tables. The one you have, a dimension table for supplier and another for country

2. Join the tables on the supplier and country

3. Hide the columns for supplier and country in your current table

4. Create a matrix that looks like your table in the OP, with supplier and country coming from the dimension tables. 
5. Then write a measure (not a column) Rev ignoring country.
CALCULATE( Sum(dataTable[Revenue]), ALL( dimTableCountry[Country] ) ).

 

https://exceleratorbi.com.au/the-optimal-shape-for-power-pivot-data/

 

 

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors