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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
BartoszKx
Regular Visitor

Measure doesn't work for records before specific date

Hi,

When I was trying to calculate average number of players in selected date range, i found out that measures doesn't work correctly for dates before 09-2014. I created this temporary measure:

tmp = CALCULATE(AVERAGEX('GameStatistics', [Avg players]), YEAR('GameStatistics'[Date]) = 2014, MONTH('GameStatistics'[Date]) = 😎


This returns blank, but if we replace 8 with 9 (September 2014) it results with 17,61

'GameStatistics' table contains data for August 2014: 

BartoszKx_1-1723802287264.png


'GameStatistic' is also in relation with Date Table:

BartoszKx_0-1723802175564.png

 

I also tried this formula:

tmp = CALCULATE(AVERAGEX('GameStatistics', [Avg players]), 'GameStatistics'[Year/Month] = "2014/8")

with same result as before.

What might be the case for this weird behaviour?
I would be very grateful for any help.


 

5 REPLIES 5
Anonymous
Not applicable

Hi @BartoszKx , rajendraongole1, thank you for your prompt reply!


Please create a simple measure to check if you could return month values in a table:

vyajiewanmsft_0-1724136839794.png

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous,

Thank you for your reply. This measure doesn't work in report. I can't retrive month from date column:

 BartoszKx_1-1724257276938.png

Here's sample data and report:
https://drive.google.com/file/d/1NdD5gDj1GWpa-6E-Zyk0yuBtH2wkP01K/view?usp=sharing

 

Anonymous
Not applicable

Hi  @BartoszKx

Thank you for your additional information, use All function to ignore any filters that might have been applied.

 

tmp = CALCULATE(AVERAGEX('GameStatistics','GameStatistics'[Avg players]), ALL(GameStatistics),YEAR('GameStatistics'[Date]) = 2014, MONTH('GameStatistics'[Date]) =8)
 

vyajiewanmsft_0-1724665491018.png

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rajendraongole1
Super User
Super User

Hi @BartoszKx - Can you check there is no missing values, blanks in Date column also incorrect datatype also results blank.check the format in Game statistics table too as you have given relationship 

 

if possible share sample data in drive to look over that give us to analysis and share expectations.

 

Thank you

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1,

Thanks for your reply. Dates columns in 'GameStatistics' and 'DateTable', have same format and data type. There aren't any blank values in this columns either.

Link for sample data and pbix file:
https://drive.google.com/file/d/1NdD5gDj1GWpa-6E-Zyk0yuBtH2wkP01K/view?usp=sharing

After this post had been created i realised that tmp value somehow depends on filter applied with slider in report page. In sample data this measure behaves differently than in orignal pbix file. When I set slider like this:

BartoszKx_0-1724254519222.png

tmp measure has value. When begin of the slider is set to 2014-06-23, then tmp value is blank:

BartoszKx_1-1724254615566.png

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors