Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a slicer that sets restricts data for month(s) in my report:
I want to create a measure that counts the amount of options selected.
If January and February are chosen, that's 2.
I tried the following but it gave an error about comparing True/False with Text:
Measure MonthSlicerCount:
Solved! Go to Solution.
Measure = COUNTROWS(VALUES('Date'[MonthYearName]))
Please note, only using VALUES here because it makes sense to use VALUES. Don't just go throwing VALUE or VALUES into every DAX calculation randomly. This is not for you @Anonymous but I've been seeing a lot of needless use of VALUE and VALUES lately. So, when I use it, I want to make sure that people understand that there is a purpose behind it.
Hi,
Please try to create a column first:
Month = 'Table'[Date].[Month]The try this measure:
Measure = DISTINCTCOUNT('Table'[Month])When you select differet month from different year, it shows:
When you select same month from different year, it shows the count of select value regardless of year:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hi,
Please try to create a column first:
Month = 'Table'[Date].[Month]The try this measure:
Measure = DISTINCTCOUNT('Table'[Month])When you select differet month from different year, it shows:
When you select same month from different year, it shows the count of select value regardless of year:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Measure = COUNTROWS(VALUES('Date'[MonthYearName]))
Please note, only using VALUES here because it makes sense to use VALUES. Don't just go throwing VALUE or VALUES into every DAX calculation randomly. This is not for you @Anonymous but I've been seeing a lot of needless use of VALUE and VALUES lately. So, when I use it, I want to make sure that people understand that there is a purpose behind it.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 49 | |
| 42 |