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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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, @Anonymous 

 

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, @Anonymous 

 

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.

MFelix
Super User
Super User

Hi @Anonymous ,

 

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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