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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User

@Anonymous , Try like

COUNTROWS(ALLSELECTED('Date'))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try like

COUNTROWS(ALLSELECTED('Date'))
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.