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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
a_gaisin
Frequent Visitor

filter doesn't impact the matrix visual properly

Hello,
I'm trying to do the following:
There's a list of projects, each of them has different status (Contract signed, in progress, finished), and owing to the fact that the status can change over time, every week the new "slice" of database is extracted and put into table.
Eventually, the table looks like this (toy data):

dataset.PNG

I need to give my users a possibility track the evolution of status of projects by selecting two dates (first date and second date) in a slicer. But since in my real data there's hundreds of projects, I also would like to add a second pair of slicers to select only certain types of status for each date.
But for some reason, when I select the values in slicers for the first date, they do not make a desirable impact on the list of project ids that are shown in matrix.

full_output.PNG

The desirable output is only ABC.

How can I fix it?
Please find the pbix file here: https://drive.google.com/file/d/1jpR-yGGOPH2sU8lxQXQbfE0PYEKmt327/view?usp=sharing 
Thank you!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Here is a slightly different approach to get your desired result.

 

1.  Keep your original Table query and your DAX table called "first status" (maybe rename it because it is used for more than that in this approach)

2.  Have no relationship between the tables

3. Make two slicers for extraction date and status from the first status table

4.  Use this measure in your matrix

Projects =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[project id] ),
    TREATAS ( VALUES ( 'first status'[extraction date] ), 'Table'[extraction date] ),
    TREATAS ( VALUES ( 'first status'[status] ), 'Table'[status] )
)

 

Your users can multi-select (Ctrl-Click) in either/both slicers to show the projects that meet the criteria.  It takes out the first/second part.  If this doesn't work, there is a more complex version that can be written that will make sure all the selected values are true for the given project (e.g., both status values are present for that project).  But I thought I would suggest this simpler one first to see if it met your needs.

projectstatus.png

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Here is a slightly different approach to get your desired result.

 

1.  Keep your original Table query and your DAX table called "first status" (maybe rename it because it is used for more than that in this approach)

2.  Have no relationship between the tables

3. Make two slicers for extraction date and status from the first status table

4.  Use this measure in your matrix

Projects =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[project id] ),
    TREATAS ( VALUES ( 'first status'[extraction date] ), 'Table'[extraction date] ),
    TREATAS ( VALUES ( 'first status'[status] ), 'Table'[status] )
)

 

Your users can multi-select (Ctrl-Click) in either/both slicers to show the projects that meet the criteria.  It takes out the first/second part.  If this doesn't work, there is a more complex version that can be written that will make sure all the selected values are true for the given project (e.g., both status values are present for that project).  But I thought I would suggest this simpler one first to see if it met your needs.

projectstatus.png

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


ebeery
Solution Sage
Solution Sage

Hi @a_gaisin ,

 

It's pretty difficult for me to discern what you're trying to do from your explanation and the small amount of sample data you've provide.  However, the immediate cause of your "Project ID" matrix not responding to the slicers is that it was using the "project id" field from the "Table" table,  which has no relationship to any of the other tables and therefore won't be filtered.

 

ebeery_0-1594076652852.png

By switching the field used to the "project id" from the "first status" table, you can achieve what you're looking for, although I'm not convinced this is best solution for the business need you're describing.  

 

ebeery_1-1594076774920.png

 



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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