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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
Anonymous
Not applicable

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 @Anonymous , 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors