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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
giacomoghezzi
New Member

Calculate Function in a measure doesn't filter all the data out

Hi,

I'm new to the community and I'm experiencing an unexpected error in Power BI. I'm working for a client and going through their sales data, which is split by regions.

 

As I would like to compare the sales volume in one region to the sales volume of all regions except that one across time I've built a line chart visualization with date on the x axis and the following values:

 

- Values:

 

Volume A = Calculate([Total Volume],(Sales[Region]="A"))
Volume (Excl. A) = SUMX(Sales,IF(Sales[Region]<>"A",Sales[Total Volume],0))
 
Now, when I build my line chart, and I add a slicer for the regions to also be able to see how other regions do (with Volume excl.a), I see that Volume A is never 0 as it should (given the filter of the  measure should prevail on the slicer), but rather some small quantities.

Can anyone help me figure out why? 

Thank you very much,

Giacomo
 
 
 
 
 
 
8 REPLIES 8
v-lili6-msft
Community Support
Community Support

hi  @giacomoghezzi 

If you could use this formula as below:

Volume (Excl. A) = CALCULATE(Sales[Total Volume],Sales[Region]<>"A")

or

Volume (Excl. A) = CALCULATE(Sales[Total Volume],FILTER(Sales,Sales[Region]<>"A"))

 

If not your case, could you please use dummy data to do a simple sample pbix file and share it and your expected output, that will be a great help.

 

Regards,

Lin

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

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

Thank you. Unfortunately I cannot post the sample data as it's client data and I've signed a NDA :(, otherwise I would have...

Best,

G

MFelix
Super User
Super User

Hi @giacomoghezzi ,

 

First of all try to change your measure to:

Volume (Excl. A) = SUMX(FILTER(Sales, Sales[Region]<> "A" ),[Total Volume]))

This may be  related with a variety of issues from missinformation in your database to syntax in formula, to relationships.

 

Probably you need to go and filter out information what I ussualy do with this cases is place the information in a table and then start to add details, in your case sales region, dates, .... and so on until you get the detail of what is having impact on your calculation.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you, 


I'll give that a try!!

Does the above reply helps. Else create a sample data and sample output in table format and provide.

 

make me @

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
yogeshmaney
Helper I
Helper I

can you share a snapshot or power bi file

Hi Yogeshmaney,

Thanks for your reply. Unfortunately I can't as it's sensitive data :(.


Best, 

Giacomo

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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