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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Oivind
Regular Visitor

Interesting conundrum using the Day function when reporting monthly

Hi guys!

I am trying to figure out how to get a "monthly" report of my data. I have data-values from date 1-17 as shown below. I’ve created the following measure:

 

Please Note:

OurDataset: The dataset we use

OurColumn1: Count

OurColumn2: Date

 

Total = CALCULATE(COUNTA('OurDataset'[OurColumn1]);FILTER(ALLSELECTED('OurDataset');'OurDataset'[OurColumn2].[Day] <=MAX('OurDataset'[OurColumn2].[Day])&&'OurDataset'[OurColumn2].[Day]<=(TODAY())))

 

One issue with using the "Day" function is that it also returns values for the other dates as well (18th to 31st).

 

The conundrum:

How do I create a report that shows the entire month, but only present the data I have, ie. 1-17.

The "Day" function will always return data in Gregorian format, and I'm fine with that, but why doesn’t the line stop at the 17th?

 

Any feedback on the matter will be much appreciated.

 

Capture1.PNG

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

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())))
1.PNG

Thanks,
Lydia Zhang

View solution in original post

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

 

 

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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())))
1.PNG

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

 

 

 

 

Anonymous
Not 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

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.