Forum Discussion
Count of count
- 4 years ago
Hi,
Please check the below picture and the attached pbix file.
It is for creating measures.
Count measure: =VAR currentVAC =MAX ( Data[Vac] )VAR newtable =FILTER ( ALL ( Data ), Data[Vac] = currentVAC )RETURNIF ( HASONEVALUE ( Data[Vac] ), COUNTROWS ( newtable ) )Count2 measure: =VAR currentCount = [Count measure:]VAR newtable =FILTER (SUMMARIZE ( ALL ( data ), Data[Vac], Data[Count CC] ),Data[Count CC] = currentCount)RETURNCOUNTROWS ( newtable ) - 4 years ago
Hi,
If you want to add slicer, please try to use ALLSELECTED function, instead of using ALL function.
Please check the attached file.
Hi,
Please check the below picture and the attached pbix file.
It is for creating new columns.
- Ilse_ScpDt4 years ago
Helper I
Hi,
Thanks for the quick reply. It is working, but is it also possible to create a measure to count the count? Because I would like to filter the result on different variables from the table, but that (ofcourse) isnt working now.
Kind regards,
Ilse
- Jihwan_Kim4 years ago
Super User
Hi,
Please check the below picture and the attached pbix file.
It is for creating measures.
Count measure: =VAR currentVAC =MAX ( Data[Vac] )VAR newtable =FILTER ( ALL ( Data ), Data[Vac] = currentVAC )RETURNIF ( HASONEVALUE ( Data[Vac] ), COUNTROWS ( newtable ) )Count2 measure: =VAR currentCount = [Count measure:]VAR newtable =FILTER (SUMMARIZE ( ALL ( data ), Data[Vac], Data[Count CC] ),Data[Count CC] = currentCount)RETURNCOUNTROWS ( newtable )- Ilse_ScpDt4 years ago
Helper I
uHi,
This measure is working the same as the calculated column, it doesnt react right on a filter.
I added a column Type to illustrate:
When filtering on Type D (or B) you would like to see 1 for Count and 1 for Count2, but instead it will show 2 for Count2 (because that is the result for the total table):
How can I make this work?