cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TomaszB
Helper II
Helper II

Filtering visual by a measure

Hello, 

I know there have been many topics, videos about it, but after trying to solve an issue on my own I am stuck.

 

Here is the thing:
I have a table that looks something like this:

TomaszB_0-1611055833070.png

Below there are project details.

 

I did create measure that count # of new projects

CALCULATE(
[Nr of projects],
Requests[Days since submission] <= 7
)
It works really well.
 
But I want to add an option to slice this visual table, by only those new projects. 
 
 
 
 
 

 https://www.youtube.com/watch?v=c0mPvzkf6i0
I followed whole video -> I did create a new table-> use switch function as measure to assign particular table values to measure, but when I click on it it still does not work.

 

Do you have an idea if there is a possibility to click on measure > and project in a table will get filtered?

Did look on topics here in community, none of which seems to work.

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @TomaszB 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

Slicer:

b2.png

 

You may create measures as below.

Days since submisson = 
IF(
           TODAY()-SELECTEDVALUE('Table'[Submission Date])<=7,
           1,0
)
Count New = 
COUNTROWS(
    FILTER(
        'Table',
        [Days since submisson]=1
    )
) 
Visual Control = 
IF(
    HASONEVALUE(Slicer[IsNew]),
    IF(
        SELECTEDVALUE(Slicer[IsNew])="Yes",
        IF(
            [Days since submisson]=1,
            1,
            0
        ),
        IF(
            [Days since submisson]=0,
            1,
            0
        )
    ),
    1
)

 

Then you may put 'Visual Control' on the visual level filter and use 'IsNew' column from 'Slicer' to filter the result.

b3.png

 

b4.png

 

Best Regards

Allan

 

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

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @TomaszB 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

Slicer:

b2.png

 

You may create measures as below.

Days since submisson = 
IF(
           TODAY()-SELECTEDVALUE('Table'[Submission Date])<=7,
           1,0
)
Count New = 
COUNTROWS(
    FILTER(
        'Table',
        [Days since submisson]=1
    )
) 
Visual Control = 
IF(
    HASONEVALUE(Slicer[IsNew]),
    IF(
        SELECTEDVALUE(Slicer[IsNew])="Yes",
        IF(
            [Days since submisson]=1,
            1,
            0
        ),
        IF(
            [Days since submisson]=0,
            1,
            0
        )
    ),
    1
)

 

Then you may put 'Visual Control' on the visual level filter and use 'IsNew' column from 'Slicer' to filter the result.

b3.png

 

b4.png

 

Best Regards

Allan

 

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

View solution in original post

MFelix
Super User III
Super User III

Hi @TomaszB ,

 

This is possible however not really sure how you have setup your model, if you simply want to filter out every projects that are new you can just place your measure on the filter of the table and select all non blank values should return expected result.

 

Can you please explain a little bit better what you want to achieve and if possible share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors