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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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