Forum Discussion
Anonymous
5 years agoNot applicable
Custom summaries when collapsing row dimensions in Matrix
Let's say I have a matrix, which has 3 dimensions in the form of rows. There's a single column called weather. Thus, the cells are filled with weather {sunny, cloudy, rainy}. Rows Dimensions: M...
- 5 years ago
Anonymous
I have prepared an example solution. Please check the file.
You can use this measure to check the levels as well as the action assignments:
Selected Date Level = SWITCH ( TRUE (), ISINSCOPE ( 'Table'[Date].[Day] ), MAX ( 'Table'[Weather] ), ISINSCOPE ( 'Table'[Date].[Month] ), VAR __SunnyDays = COUNTROWS ( FILTER ( 'Table', 'Table'[Weather] = "Sunny" ) ) RETURN IF ( ISBLANK ( __SunnyDays ), 0, __SunnyDays ) & "/" & COUNTROWS ( 'Table' ), ISINSCOPE ( 'Table'[Date].[Quarter] ), VAR __SunnyDays = COUNTROWS ( FILTER ( 'Table', 'Table'[Weather] = "Sunny" ) ) RETURN IF ( ISBLANK ( __SunnyDays ), 0, __SunnyDays ) & "/" & COUNTROWS ( 'Table' ), ISINSCOPE ( 'Table'[Date].[Year] ), VAR __SunnyDays = COUNTROWS ( FILTER ( 'Table', 'Table'[Weather] = "Sunny" ) ) RETURN IF ( ISBLANK ( __SunnyDays ), 0, __SunnyDays ) & "/" & COUNTROWS ( 'Table' ), BLANK () )Proud to be a Super User.
If I helped, please accept the solution
and give kudos!
richbenmintz
Resident Rockstar
5 years agoHi Anonymous ,
I would suggest that you create 3 Measures
Sunny = Calculate(COUNTROWS('Table'), 'Table'[weather]="sunny")
Cloudy= Calculate(COUNTROWS('Table'), 'Table'[weather]="cloudy")
Rainy = Calculate(COUNTROWS('Table'), 'Table'[weather]="rainy")
Then use these measures in your visual to display the count of weather events