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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AishwariyaV
Helper IV
Helper IV

Dynamic columns in matrix by filtering two different slicers

Hi All,

 

I am working on a HR dataset, which has users, skills, departments and their ratings data.

 

One user can have different ratings in different departments and in different skills.

 

I have hierarchy slicers which have Skills -> Ratings separately for each departments.

 

If i select ratings from two different departments(from two department slicers) and two different skills, it has to dyanmically be displayed in a matrix visual with selected skill and rating.

 

Data:

UserDeptSkillRating
AnitaDepartment 1A1
DeepakDepartment 1A2
AnitaDepartment 1B1
DeepakDepartment 1B2
ManishDepartment 1B3
VivekDepartment 2c1
ManishDepartment 2D1
AnitaDepartment 2D

2

 

Output :

Say, i have selected Skill A and Rating 1 (Dept Slicer 1) & Skill D and Rating 2 (Dept Slicer 2)

 

User nameSkill ASkill D
Anita12

 

Could anyone help on this

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @AishwariyaV ,

 

You need to create two table to make the filtering of your data I have used the following codes:

 

Slicer 1 = SUMMARIZE('Table','Table'[Rating],'Table'[Skill])

Slicer 2 = SUMMARIZE('Table','Table'[Rating],'Table'[Skill])

 

Now create the following measure:

Rating _Selected _ skills = 
IF (
     (
        SELECTEDVALUE ( 'Table'[Skill] )
            IN VALUES ( 'Slicer 1'[Skill] )
                && SELECTEDVALUE ( 'Table'[Rating] ) IN VALUES ( 'Slicer 1'[Rating] )
    )
        || (
            SELECTEDVALUE ( 'Table'[Skill] )
                IN VALUES ( 'Slicer 2'[Skill] )
                    && SELECTEDVALUE ( 'Table'[Rating] ) IN VALUES ( 'Slicer 2'[Rating] )
        ),
    MAX ( 'Table'[Rating] )
)

Now format your matrix with the following way:

  • Rows: User
  • Columns: Skill
  • Values: Measure

Result below and in attach PBIX file:

MFelix_0-1613996705095.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @AishwariyaV ,

 

You need to create two table to make the filtering of your data I have used the following codes:

 

Slicer 1 = SUMMARIZE('Table','Table'[Rating],'Table'[Skill])

Slicer 2 = SUMMARIZE('Table','Table'[Rating],'Table'[Skill])

 

Now create the following measure:

Rating _Selected _ skills = 
IF (
     (
        SELECTEDVALUE ( 'Table'[Skill] )
            IN VALUES ( 'Slicer 1'[Skill] )
                && SELECTEDVALUE ( 'Table'[Rating] ) IN VALUES ( 'Slicer 1'[Rating] )
    )
        || (
            SELECTEDVALUE ( 'Table'[Skill] )
                IN VALUES ( 'Slicer 2'[Skill] )
                    && SELECTEDVALUE ( 'Table'[Rating] ) IN VALUES ( 'Slicer 2'[Rating] )
        ),
    MAX ( 'Table'[Rating] )
)

Now format your matrix with the following way:

  • Rows: User
  • Columns: Skill
  • Values: Measure

Result below and in attach PBIX file:

MFelix_0-1613996705095.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors