Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
malpani
Helper I
Helper I

Matrix visual - Show Count of event when aggregated

Hello Experts, 

I am trying to create a calendar view using Matrix visual to show all product milestones event. 
I have two fields on rows - Product Name and Release Name. When Product name is expanded it shows each Release Name in separate row.
On columns I have added Year, Month and Day.
In values, I have a measure 'Event'. Event measure is given in attached sample PBIX file - https://drive.google.com/file/d/1C7rtWnvx1kiJsCbvW0f5Y_jtdmxEX-r_/view?usp=sharing

This view is fine when rows are expanded.

malpani_0-1707313035556.png

But when I collapse rows it consolidates and shows all values from indiviual rows.
Current output when rows are collapsed - 

malpani_1-1707313351303.png


Expected output - 
When rows are collapsed, I would like to show only count of Milestones as shown below - 

malpani_2-1707313664417.png

 

It would be even better if it always shows such count of Milestone when rows are collapsed/expanded.


I tried but I could not manage to modify 'Event' measure to have different behaviour when rows are collapsed or expanded.

 

Regards

 

2 ACCEPTED SOLUTIONS
Daniel29195
Super User
Super User

@malpani 

 

usethe isinscope()  function.  

isinscope functions lets you control the calculation you want to achieve base on the level of hiearrchy of a matrix.

 

example : 

measure = 

switch(

true() , 

isinscope( tabl_name[col_name_1] , [ measure 1 ] , 

isinscope( tabl_name[col_name_2] , [ measure 2 ] , 
isinscope( tabl_name[col_name_3] , [ measure 3] , 

....

 

 

hope this helps .

 

 

NB: always start your switch(   isinscope() with the lowest level 

example if yuor matrix is : 

category -->  subcategory -->  product

start : 

switch(

true() , 

isinscope( product[product_name] , [ measure 1 ] , 

isinscope( subcategory[subcategory_col_name] , [ measure 2 ] , 
isinscope( category[categroy_col_name] , [ measure 3] , 

....

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

View solution in original post

@malpani 

you can create a measure like this : 

 

measure = 

switch(

true() , 

condition , " color_in_hexa_ or _ color name "   --  [ ex :  #ffffff or  white ]

condition2 ,   " color_in_hexa_2 or _ color name_2  "

)

 

 

 

then you use this measure in the conditional formatting : 

Daniel29195_0-1707376329168.png

you choose field value , then you select the measure you have created . 

Daniel29195_1-1707376339661.png

 

 

 

hope this makes sense. 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

 

View solution in original post

5 REPLIES 5
Daniel29195
Super User
Super User

@malpani 

 

usethe isinscope()  function.  

isinscope functions lets you control the calculation you want to achieve base on the level of hiearrchy of a matrix.

 

example : 

measure = 

switch(

true() , 

isinscope( tabl_name[col_name_1] , [ measure 1 ] , 

isinscope( tabl_name[col_name_2] , [ measure 2 ] , 
isinscope( tabl_name[col_name_3] , [ measure 3] , 

....

 

 

hope this helps .

 

 

NB: always start your switch(   isinscope() with the lowest level 

example if yuor matrix is : 

category -->  subcategory -->  product

start : 

switch(

true() , 

isinscope( product[product_name] , [ measure 1 ] , 

isinscope( subcategory[subcategory_col_name] , [ measure 2 ] , 
isinscope( category[categroy_col_name] , [ measure 3] , 

....

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

Hi @Daniel29195,

Many thanks for the guidance. It worked for me.
I have one more question on the measure I have - 
I want to show date part of this measure in different color. Is it possible to add a color ?

Events =
VAR EventList =
    CONCATENATEX (
        FILTER (
            'Excel_Manual',
            NOT ISBLANK ( 'Excel_Manual'[Milestone] ) && NOT ISBLANK ( 'Excel_Manual'[DESIGN ELEMENT DESC_Format] )
        ),
        IF (
            'Excel_Manual'[Index] > 1,
            UNICHAR(10),
            ""
        ) &
        FORMAT ( 'Excel_Manual'[Date_Roadmap], "d MMM" ) & UNICHAR(10) &
        'Excel_Manual'[Milestone] & " " & 'Excel_Manual'[DESIGN ELEMENT DESC_Format],
        UNICHAR(10)
    )
RETURN
    IF (
        NOT ISBLANK ( EventList ),
        EventList,
        BLANK ()
    )




@malpani 

you can create a measure like this : 

 

measure = 

switch(

true() , 

condition , " color_in_hexa_ or _ color name "   --  [ ex :  #ffffff or  white ]

condition2 ,   " color_in_hexa_2 or _ color name_2  "

)

 

 

 

then you use this measure in the conditional formatting : 

Daniel29195_0-1707376329168.png

you choose field value , then you select the measure you have created . 

Daniel29195_1-1707376339661.png

 

 

 

hope this makes sense. 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

 

@Daniel29195
In the measure 'Event' it has two fields - Date and Design Element Format concatenated. 
I cannot  separate them else it will display first all Dates and then Design Element. 
I want to show them concatenated with each date. 
But to make it more readable, I want to highlight Date in different color.
Currently it is shown like this 

malpani_0-1707377016353.png

 


 

@malpani 

you want to highlight only the date in the cell . right ? 

this isnt doable as far as i know .

you can change the the font color of the whole cell text .

 

maybe to highlight the date in the cell,  you can add another unichar(10) . to increment the space between the date and the data in the same cell . 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.