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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
left4pie2
Helper I
Helper I

Measure Not Filtering Correctly

Hello,

 

I'm trying to show a sparkline of a data set for all time, and compare it to the average of that data set for just the past week. Below is  a screenshot with my measure, my matrix table that isn't working, and a table that's showing all my data. I've also attached the .pbix file.

 

left4pie2_0-1646754564371.png

My problem is if for a given week there's no data for one of the vendors, rather than showing 0 it gives an incorrect average. What's also strage is this incorrect average is not factored into the total average. So in my matrix the average for A, B and the total is correct, but the average for C is wrong and should be 0 or null. Any ideas of how I can fix this?

 

Thanks!

 

Example.pbix

1 ACCEPTED SOLUTION
AllisonKennedy
Community Champion
Community Champion

@left4pie2  Not sure what your data model relationships look like but seems like maybe the StartofWeek variable is getting filtered by your Vender, and so showing the previous week. 

 

Try adding an ALL to your MAX date variable and see if that helps.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

2 REPLIES 2
AllisonKennedy
Community Champion
Community Champion

@left4pie2  Not sure what your data model relationships look like but seems like maybe the StartofWeek variable is getting filtered by your Vender, and so showing the previous week. 

 

Try adding an ALL to your MAX date variable and see if that helps.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

That worked!

left4pie2_0-1646842753669.png
I used the calculate function around the maxdate variable and used all to cancel the filters.

 

Thanks for the help!! 🙂

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.