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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! 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
Super User
Super User

@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
Super User
Super User

@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
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors