cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

DISTINCT AND DISTINCT COUNT Bugs on DATEs

Why Distinct count days, DistinctCount counts Months?

 

This measure counts Months but only for one selected year

 

SelectedMonthsCount =
SWITCH(
TRUE(),
ISFILTERED(_Date[Date].[Month]), DISTINCTCOUNT(_Date[Date].[Month]),
DISTINCTCOUNT(_Date[Date].[Month])
)
 

This measure counts Days but for any selected years

 

SelectedDaysCount =
SWITCH(
TRUE(),
ISFILTERED(_Date[Date].[Month]), COUNT(_Date[Date].[Month]),
COUNT(_Date[Date].[Month])
)
 
 
How to count Selected Months For any selected Years?
 
1 ACCEPTED SOLUTION
Solution Specialist
Solution Specialist

@Analitika Hi,

 

You just need to create a new column :

Month = MONTH('Date'[Date]) 
instead of using Date[Date].[Month],
then you can use DISTINCTCOUNT() for it.

View solution in original post

1 REPLY 1
Solution Specialist
Solution Specialist

@Analitika Hi,

 

You just need to create a new column :

Month = MONTH('Date'[Date]) 
instead of using Date[Date].[Month],
then you can use DISTINCTCOUNT() for it.

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.