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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Arul

Building Slicers from Existing Attributes

Problem:

You have student data with attributes representing performance in different subjects, and you want to create a filter that allows users to select the number of failed attributes for each student. The goal is to dynamically display students who have failed a certain number of attributes based on user selection.

 

Data:

Arul_0-1708061337607.png

 

Solution:

We need to create a new calculated column that calculates the number of failed subjects for each student. In our case Failed Count is the calculated column.

 

Arul_1-1708061368995.png

 

Failed Count = 
IF ( 'Table'[Subject 1] = "F", 1, 0 )
    + IF ( 'Table'[Subject 2] = "F", 1, 0 )
    + IF ( 'Table'[Subject 3] = "F", 1, 0 )

 

 

This DAX formula evaluates whether a student failed in Subject 1, Subject 2, or Subject 3 by checking if the grade is "F". If the condition is met, it assigns a value of 1; otherwise, it assigns 0. Finally, it sums up these values to determine the total count of failed subjects for each student.

 

Output:

Finally, we can utilize the newly created calculated column in the slicer to filter student attributes within the visual.

Arul_2-1708061872229.png

Arul_3-1708061890403.png