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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Madhu155154
Helper I
Helper I

How to set Default filter for Matrix or Table

Hi everyone, I want a matrix to show values for a particular filter, L1, from KPI Level by default.


Note:  I will use KPI Level as a slicer. When I click on the L2 slicer, the table should display L2 data. For L3 selection, it should show L3 data, and for L1, it should show L1 data.

 

If no filters from the KPI Level slicer are selected, the table should display only L1 data by default.

The table needs to include the following columns:

- KPI Level
- Region
- Category
- Target
- Actual

Below is the data view of the dataset:

 

Madhu155154_0-1723540461180.png


ChatGPT data prompt:  https://chatgpt.com/share/b2a755d3-e928-4817-80ef-a643de3c6bf0

Dax formula i used: 

Defualt_Target =

Var _a = SELECTEDVALUE(Data[KPI Level], "L1")

Var _b = CALCULATE(sum(Data[Target]), FILTER(Data,
Data[KPI Level]= _a ))

RETURN _b



I am not able to acheive the result what i wanted

1 ACCEPTED SOLUTION
Rupak_bi
Super User
Super User

Hi Based on my understanding, here is my solotion

Rupak_bi_0-1723553256664.png

Rupak_bi_1-1723553279668.pngRupak_bi_2-1723553290214.pngRupak_bi_3-1723553299598.png

Approach I used here is  - 
1. created a new disconnected table with KPI values
2. switched the output based on KPI filters. formula as below:

 

 

sum of target =
SWITCH(TRUE(),SELECTEDVALUE('Table (2)'[KPI Level],"L1")=max('Table (3)'[new kpi]),calculate(sum('Table (2)'[Target]),'Table (2)'[KPI Level]=max('Table (3)'[new kpi])))


if this solves your purpose, please accept this as solution.


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

View solution in original post

2 REPLIES 2
ahadkarimi
Solution Specialist
Solution Specialist

@Madhu155154create the two measures below, try them out, and let me know if there are any issues.
ahadkarimi_0-1723578584685.pngahadkarimi_1-1723578596265.pngahadkarimi_2-1723578606436.png

Filtered_Target =
VAR SelectedKPI = SELECTEDVALUE(Data[KPI Level], "L1")
RETURN
CALCULATE(
    SUM(Data[Target]),
    Data[KPI Level] = SelectedKPI
)
Filtered_Actual =
VAR SelectedKPI = SELECTEDVALUE(Data[KPI Level], "L1")
RETURN
CALCULATE(
    SUM(Data[Actual]),
    Data[KPI Level] = SelectedKPI
)

 

Rupak_bi
Super User
Super User

Hi Based on my understanding, here is my solotion

Rupak_bi_0-1723553256664.png

Rupak_bi_1-1723553279668.pngRupak_bi_2-1723553290214.pngRupak_bi_3-1723553299598.png

Approach I used here is  - 
1. created a new disconnected table with KPI values
2. switched the output based on KPI filters. formula as below:

 

 

sum of target =
SWITCH(TRUE(),SELECTEDVALUE('Table (2)'[KPI Level],"L1")=max('Table (3)'[new kpi]),calculate(sum('Table (2)'[Target]),'Table (2)'[KPI Level]=max('Table (3)'[new kpi])))


if this solves your purpose, please accept this as solution.


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.