Forum Discussion
Interesting conundrum using the Day function when reporting monthly
- Anonymous9 years ago
Hi Oivind,
I test the scenario as yours and get the same issue, when I add .[Day] after Date column, it presents other dates(18th-31st). I suspect the issue is caused by the .[Day] function, unfortunately, I am not able to find any official articles stating the usage of this function.
In your scenario, you can remove .[Day] from the formula. I test it and everything works as expected, you can check the following screenshot and this attached PBIX file.
Total = CALCULATE(COUNTA('OurDataset'[OurColumn1]);FILTER(ALLSELECTED('OurDataset');'OurDataset'[OurColumn2]<=MAX('OurDataset'[OurColumn2])&&'OurDataset'[OurColumn2]<=(TODAY())))
Thanks,
Lydia Zhang - 9 years ago
Hello Anonymous,
I thought I had tried everything but sometimes the solution is much more simpler than what you expect!
Thank you very much for contribution!
Kind regards,Øyvind
Hi Oivind,
I test the scenario as yours and get the same issue, when I add .[Day] after Date column, it presents other dates(18th-31st). I suspect the issue is caused by the .[Day] function, unfortunately, I am not able to find any official articles stating the usage of this function.
In your scenario, you can remove .[Day] from the formula. I test it and everything works as expected, you can check the following screenshot and this attached PBIX file.
Total = CALCULATE(COUNTA('OurDataset'[OurColumn1]);FILTER(ALLSELECTED('OurDataset');'OurDataset'[OurColumn2]<=MAX('OurDataset'[OurColumn2])&&'OurDataset'[OurColumn2]<=(TODAY())))
Thanks,
Lydia Zhang
Hello Anonymous,
I thought I had tried everything but sometimes the solution is much more simpler than what you expect!
Thank you very much for contribution!
Kind regards,
Øyvind
- Anonymous9 years agoNot applicable
Hi Oivind,
Glad to hear that the issue is resolved. We will appreciate it if you can accept helpful reply as solution, that way, other community members will easily find the solution when they get same issues.
Thanks,
Lydia Zhang- Oivind9 years agoRegular Visitor
Hello again, Anonymous,
I had to add .[date] to the formula to count today's date as well. So the formula modified looks like this:Now it works perfect!
Total = CALCULATE(COUNTA('OurDataset'[OurColumn1]);FILTER(ALLSELECTED('OurDataset');'OurDataset'[OurColumn2]<=MAX('OurDataset'[OurColumn2])&&'OurDataset'[OurColumn2].[Date]<=(TODAY())))
Regards,
Øyvind