This is what I tried but it returned value of 12 for the entire year.
I did get it to work though by calculating the average for each month first. Here's what I used:
YTD Monthly Avg =
CALCULATE( [Monthly Avg],
FILTER(ALL('Calendar'),
'Calendar'[Month] <= MAX('Calendar'[Year]) &&
'Calendar'[Year] = MAX('Calendar'[Year]) ) )
------------------------------
Sana Ghansar
Sabre Limited
Cambridge ON
519-585-7524
------------------------------
Original Message:
Sent: Aug 07, 2022 09:51 PM
From: Vilmar Santos
Subject: Count Number of Months from data sample set
Tente
Medida =COUNTROWS ( SUMMARIZE ( Sales, Sales[DocumentDate].[MonthNo] ) )
------------------------------
Vilmar Santos
Original Message:
Sent: Aug 04, 2022 11:51 AM
From: Sana Ghansar
Subject: Count Number of Months from data sample set
Hello,
I am trying to do a distinct count on number of months listed in a table based on Document Date.
The following formulas return a value of 12 even though only 7 months are listed in the actual dataset (Jan-Jul)
Distinctcount(Sales[DocumentDate].[Month])
Countrows(Sales[DocumentDate].[Month])
Any idea why these return 365 days or 12 months instead of 7? I confirmed that the start and end dates are January to July and that there are no other entries.
Thanks