cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Counting Number of Days in Hierarchical Date Slicer

Hello,

 

On one page I have a "between" date slicer and to count the number of days in the selection I made this measure

 

DaysPlanned = COUNTROWS(ALLSELECTED('Date'[Date]))
 
It works fine as you can see:
 
 
PBIDesktop_VmetUufgk8.png

 

When using regular dates and this kind of slicer it still works fine.

 

PBIDesktop_hVEHiJQH3M.png

The problem arises when I'm trying to turn my slicer into a hierarchical slicer. Suddenly I get wrong values.

 

 

PBIDesktop_GnI0qIHe2r.png

 

No matter which element of the slicer I click on I get 214.

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@Anonymous , Try like

COUNTROWS(ALLSELECTED('Date'))


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User IV
Super User IV

@Anonymous , Try like

COUNTROWS(ALLSELECTED('Date'))


Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Anonymous
Not applicable

Thats interesting...

 

Thanks that worked. I am so confused as to why 'Date'[Date] won't work but 'Date' does.

 

Any insight why? @amitchandak 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

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

Top Solution Authors
Top Kudoed Authors