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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JimOnABike
Regular Visitor

Same Filters - Different Behaviour

Hi guys,

 

I built the following DAX measure, which gives the total revenue for the current year, irrespective of filters applied:

 

TotalRevCurrentYear = CALCULATE(SUM(Revenue[Revenue]),
FILTER(ALL('Date'),'Date'[year] = MAXX(ALL('Date'),'Date'[year])))
 
It behaves exactly as planned. I then built a second measure, with exactly the same filters, but using Units sold:
 
TotalUnitsCurrentYear = CALCULATE(SUM(Revenue[Units_Sold]),
FILTER(ALL('Date'),'Date'[year] = MAXX(ALL('Date'),'Date'[year])))
 
But with this, as I click on dimension in the report, the values of the measure change...
 
Porting in from a different BI environment, so any help getting to grips with understanding PBI intereactions and behaviours greatly appreciated.
 
1 ACCEPTED SOLUTION
JimOnABike
Regular Visitor

Guys - I had allocated the wrong measure to the Card!

 

It's now working as expected thanks for your time.

 

In my defence - I'm about 3 hours into this and have a few measures starting "TotalRevenue*"  

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @JimOnABike ,

 

It looks like your problem has been solved, please mark the helpful reply and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster .
Thank you very much for your kind cooperation!

Best Regards,
Dengliang Li

Ashish_Mathur
Super User
Super User

Hi,

Just select the current year in the slicer and these 2 measures should work

Rev = sum(Revenue[Revenue])

Units = sum(Revenue[Units_sold])

Hope this helps.

 


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

Guys - I had allocated the wrong measure to the Card!

 

It's now working as expected thanks for your time.

 

In my defence - I'm about 3 hours into this and have a few measures starting "TotalRevenue*"  

 

danextian
Super User
Super User

Hi @JimOnABike 

 

Did you click on dimensions other than from the Date table? If so, that is expected as the filter modifier is applied to that table only.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
shafiz_p
Super User
Super User

Hi @JimOnABike  To get exact result, it is better to provide representative data and desired output. It is not clear, what is changing actually. Since, ALL removes all filters from the specified table, but if there are other filters or slicers applied to the 'Revenue' table, they might still affect the measure. So, to include only current year, you could try this filter:

 

FILTER(
        ALL('Date'),
        'Date'[year] = YEAR(TODAY())
    )

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution

 

Best Regards,
Shahariar Hafiz

Thanks for coming back on this. Expected behaiour (wanted) is for both card values to be unaffected by a change in filter. Here I have filtered to 2020 (the MAX year in the dataset). Revenue is 2.5bn, Units Sold is 476:

 

JimOnABike_0-1737224698440.png

Now if I change the  filter (top-left) to 2019...

JimOnABike_1-1737224874071.png

Total Number of Units has changed, but Total Revenue is unaffected.

I do want selections made to country and product dimensions to change the card values, and they do. What I don't understand is why two measures from the same table, using the same filter() are giving different behaviour...

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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