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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Mark_Berry
Helper I
Helper I

Create DAX to filter table.

Hello everyone,

 

I have created a report with a custom slicer which serves the purpose of showing information related to certain measures. 
In this case a status and rating based off the specific KPIs for each result area. Each Result area is on the same report page and my current slicer is developed to switch between each KPI. 

In the source workbook each KPI is score using varied criteria eg some are % whilst some are time range based or staff number based. 


I have been asked to add a table which shows criteria for each specific KPI and for it to change with the current slicer selection 

 

the source table looks as such 

Mark_Berry_0-1695285974915.png

I want to be able to slice between each KPI and show the specific criteria whilst retaining the Rating and Status columns

Mark_Berry_1-1695286105524.png

an example of one of my slicer measures is as such (Please note I have sanitised the DAX)

 Status = if(
HASONEVALUE('Slicer Table'[Value1]),
SWITCH(
VALUES('Slicer Table'[Value1]),
"1.4", SUMX('1.4','1.4 '[Status]),
"1.1", SUMX('1.1 ','1.1 '[Status]),
"1.2 ", SUMX('1.2 ','1.2 '[Status]),
"1.3 ", SUMX('1.3 ','1.3 '[Status])))
 
Thanks
2 REPLIES 2
vs_7
Continued Contributor
Continued Contributor

HI @Mark_Berry ,

follow below steps

    • Create a new table in your data model that contains the KPI values and their corresponding criteria. This table should not have any relationships with other tables to keep it disconnected. It might look something like this:

      Create a Criteria Table:

 

  • KPI Criteria KPI Criteria 1.1 Criteria for KPI 1.1 1.2 Criteria for KPI 1.2 1.3 Criteria for KPI 1.3 1.4 Criteria for KPI 1.4
  • Create a DAX Measure for Criteria:

  1. Selected Criteria = VAR SelectedKPI = SELECTEDVALUE('Slicer Table'[Value1]) RETURN CALCULATE( MAX('KPI Criteria'[Criteria]), FILTER('KPI Criteria', 'KPI Criteria'[KPI] = SelectedKPI) )

    This measure will return the criteria corresponding to the selected KPI in the slicer.

  2. Display the Criteria in a Table Visual:

    • In your report, add a table visual.
    • Place the 'Status' measure, 'Rating' measure, and the 'Selected Criteria' measure in the table. Each row will display the criteria for the selected KPI along with the status and rating.

Thanks @vs_7 , coul you please clarify how to create the criteria table?

I have imported the excel table I showed in my original post and it looks like such 

Mark_Berry_0-1695345617689.png

 or should I expand this table to include the ratings, status and criteria? 

Mark_Berry_1-1695345725932.png

 

I also have some KPIs which return a text value in the criteria so what considerations should I have WRT these values?



Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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