Forum Discussion
Line chart show 0 for missing data and when slicer applied
- 5 years ago
Hi Binway ,
Please change the relationship between your date table and fact table to single direction
Then use the following measure:
New Amounts = VAR __min = CALCULATE ( MIN ( MonthlySales[month_starting]), ALLSELECTED(MonthlySales)) VAR __max = CALCULATE ( MAX ( MonthlySales[month_starting]), ALLSELECTED(MonthlySales)) VAR RESULT = IF(MAX(date_dim[first_day_of_month])>=DATE(YEAR(__min-10),MONTH(__min-10),1)&&MAX(date_dim[first_day_of_month])<=__max , SUM(MonthlySales[Sales])+0) return RESULTIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Sorry Dedmon - same result where the +0 is just not working if you filter it. How would I create a "virtual table" with all the missing values, then filter that.
Thanks - appreciate the efforts.
- Binway5 years ago
Helper II
Thanks for looking at this.
You should be able to get the pbix from google drive here - LineChartTest
All I am trying to do is add 0 for the missing values when connected to the date_dim, which works fine but no matter what I do I can't then filter this data down to just display the date values in the data table.
Binway
- v-deddai1-msft5 years ago
Community Support
Hi Binway ,
Please check the permission of the shared file. I can't download it.
Best Regards,
Dedmon Dai
- Binway5 years ago
Helper II
Not sure why it did that anyway here is a new link.
https://drive.google.com/file/d/1fqXrM1UZxt-sAOsOHTElOxK12_sPQuyx/view?usp=sharing
- v-deddai1-msft5 years ago
Community Support
Hi Binway ,
Please change the relationship between your date table and fact table to single direction
Then use the following measure:
New Amounts = VAR __min = CALCULATE ( MIN ( MonthlySales[month_starting]), ALLSELECTED(MonthlySales)) VAR __max = CALCULATE ( MAX ( MonthlySales[month_starting]), ALLSELECTED(MonthlySales)) VAR RESULT = IF(MAX(date_dim[first_day_of_month])>=DATE(YEAR(__min-10),MONTH(__min-10),1)&&MAX(date_dim[first_day_of_month])<=__max , SUM(MonthlySales[Sales])+0) return RESULTIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
- Binway5 years ago
Helper II
Thanks so much Demon,
I'll see how it works on the real data.
Thanks again.
Binway