We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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!! 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 56 | |
| 40 | |
| 35 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 38 | |
| 34 | |
| 23 |