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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Dataseeker009
New Member

How to show default Rows in Matrix Visual Chart even though Slicer is applied on page.

I have a table with task names, categories , bunch other details associated with tasks. The table is composed as below

taskNameRoledetails
Task 1Devabc
Task 2QAabc
Task 3Devabc
Task 4QAabc
Task 5Managerabc
Task 6Supervisorabc
Task 7Allabc
Task 8All Otherabc
Task 9Allabc

Now, when create a slicer based on Role column ( created dimension out the it and used it for slicer) and applied QA Role the matrix chart slices the data for only task 2 and task 4. But the requirement is show task 2, task 4 and task 7, task 8, task 9 along with. So apart from the selection of All and All other roles which ever is selected it should show that role task and the default Role tasks.
For this I created Flag metric and applied on the visual
Flag metric:
Flag =
var _selectedRole = selectedvalue(RoleDimension[Role])
return
 IF
(
OR(
MAX(Table[Role]) = _selectedRole, MAX(Table[Role]) = "All"), 1, 0
)
Expectation from the above was it would assign the value of 1 to rows where Role is "All" and selected Role from slicer. But the visual only filters for selected Role leaving out the defaults rows.
Expected results
When Role = QA, it should show as below

taskNameRoledetails
Task 2QAabc
Task 4QAabc
Task 7Allabc
Task 8Allabc
Task 9Allabc


How to acheive this functionality. Any help and approach to this problem would helpful.


1 ACCEPTED SOLUTION
quantumudit
Super User
Super User

Hello @Dataseeker009 

To simplify the process, you can take the following steps:

 

Create a dimension table as shown:

quantumudit_0-1728375095203.png

 

Next, establish a relationship with these properties:

quantumudit_1-1728375140616.png

 

 

 

This should yield the desired outcome, as illustrated here:

 

quantumudit_2-1728375181675.png

This method is a quick fix, but it may lead to complications with more complex data models in the future. A more effective solution would require a deeper understanding of your data model's structure and intricacies.

 

For straightforward data models, this approach should suffice and can be implemented.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

View solution in original post

5 REPLIES 5
Dataseeker009
New Member

Thank you for reply and solutions quantumudit , @Kedar_Pande , @Anonymous.
The solution using the flag metric still filters the main table of exclusive filters on the matrix table, But the solution of creating a composite Role dimension works in current context of my problem.

Anonymous
Not applicable

Hi @Dataseeker009 ,

 

Thanks for the reply from Kedar_Pande  and quantumudit , please allow me to provide another insight: 

 

The OR function in DAX takes only two arguments, so you can use the OR operator (||) to join all calculations into a simpler expression.

 

Flag =
VAR _selectedRole = SELECTEDVALUE(RoleDimension[Role])
RETURN
IF (
MAX('Table'[Role]) = _selectedRole ||
MAX('Table'[Role]) = "All" ||
MAX('Table'[Role]) = "All Other",
1,
0
)

 

It is worth noting that do not create a relationship between the two tables.

vkaiyuemsft_0-1728441249368.png

 

The final result is shown below, more details can be found in the attachment.

vkaiyuemsft_1-1728441257056.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

 

Kedar_Pande
Super User
Super User

Flag measure:

Flag =
VAR _selectedRole = SELECTEDVALUE(RoleDimension[Role])
RETURN
IF (
OR (
MAX(Table[Role]) = _selectedRole,
MAX(Table[Role]) = "All",
MAX(Table[Role]) = "All Other"
),
1,
0
)

 

Add a visual level filter using the Flag measure:
Set the filter condition to show only rows where Flag equals 1.

 

Make sure your slicer is based on the RoleDimension[Role] field, so when users select "QA", the Flag measure will determine which tasks to display.

quantumudit
Super User
Super User

Hello @Dataseeker009 

To simplify the process, you can take the following steps:

 

Create a dimension table as shown:

quantumudit_0-1728375095203.png

 

Next, establish a relationship with these properties:

quantumudit_1-1728375140616.png

 

 

 

This should yield the desired outcome, as illustrated here:

 

quantumudit_2-1728375181675.png

This method is a quick fix, but it may lead to complications with more complex data models in the future. A more effective solution would require a deeper understanding of your data model's structure and intricacies.

 

For straightforward data models, this approach should suffice and can be implemented.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

Kedar_Pande
Super User
Super User

Flag =
VAR _selectedRole = SELECTEDVALUE(RoleDimension[Role])
RETURN
IF (
OR (
MAX(Table[Role]) = _selectedRole,
MAX(Table[Role]) = "All",
MAX(Table[Role]) = "All Other"
),
1,
0
)

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 community update carousel

Fabric Community Update - June 2025

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