The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.