Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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.
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!
Solved! Go to Solution.
@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.
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
@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.
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!
I used the calculate function around the maxdate variable and used all to cancel the filters.
Thanks for the help!! 🙂
User | Count |
---|---|
105 | |
69 | |
48 | |
47 | |
47 |