- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Slicer - How can I count selected months?
Hi Guys,
how can I or is it possible to count how many months I have selected in a Date-Slicer? I want to divide a value with the count of monts, e.g. earnings / selected months ... All variants do not show me the correct number of months - only distinctcount brings 12 months 😉
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi
I have also tried this solution using "ISFILTERED" or "ISCROSSEDFILTERED" and both options only
result in 0. I have two items selected in my slicer. Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count = IF( ISFILTERED(Months[Month]), COUNT(Months[Month]), 0 )
This will count if the months column is selected directly. If you want to account for the months column being filtered indirectly, use ISCROSSEDFILTERED instead of ISFILTERED.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vega,
thank you - unfortunately, the value is always "0" instead of, in this example, "5":
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you post your Date table? How is the slicer being created? Like I said earlier, if the months are not being filtered directly, then you need to use ISCROSSFILTERED.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have tested both ISFILTERED and ISCROSSFILTERED - below you'll find the screenshot from the table field:
Slicer (Timeline) is configured only with the "Date" field:
Again - many thanks for your support 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is certainly more optimize way to do it.
But for example you can duplicate your date column convert it into a type text, and concatenate the year and the month.
And then do a DISTINCTCOUNT of your new column.
Example of M query to get your year and month
Text.Range([Date], 6,4) & Text.Range([Date], 3, 2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i too would like to know how to do this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi cylix,
till now I do not have a proper solution for that...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, have you had any luck with this? I am tasked with doing something similar to this as well but the above solutions provided do not work. Please advise.
Thank you. @posterme
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does your date table have a months column?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, its only a column defined as date field...
UPDATE:
And as I written in my first message,
with COUNT('TABLE'[Date].[Month]) the Value is 1096,
with DISTINCTCOUNT('TABLE'[Date].[Month]) it is 12 ...
But what is "1096" ? 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe 1096 is the number of dates in your date column

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
05-10-2024 01:36 AM | |||
10-10-2024 11:04 PM | |||
08-15-2024 03:58 AM | |||
09-15-2024 08:24 PM | |||
07-21-2024 08:02 PM |