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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Patrick1612
Frequent Visitor

Visual shall use specific rows depending on slicer selection

Hello,

I have following issue and would be very happy if some one could help me:

I have a table and I want to count the unique ID's, grouped by their value. Thus I use e.g. a pie chart. However, there is also a data slicer in the report. If this slicer is not used, I want to count all rows which have indicator 1, otherwise the rows with indicator 0. At that point, I don't know how to implement this.

 

Fact table:

IDValueIndicator
111
11000
2101
21000
3101
3100

 

I have found a solution by using measures, but I don't want to use it as the drillthrough with a measure do not keep the indicator filter. Additionally, I use the fact table also for other calculations and with measures, I lose the context filtering to other visuals.

Any ideas how to solve it?

Greetings,
Patrick

1 ACCEPTED SOLUTION

@Patrick1612 , Create on more Table with following Values

Indicator , Flag

1 , Yes

0, No

1, No

 

Join this with Indicator field of you table Many to Many, and filter direction from this new tables to your table.

 

Now use this new table in filter

 

All these videos in playlist uses same concept to solve different issues
https://www.youtube.com/watch?v=C9K8uVfthUU&list=PLPaNVDMhUXGYQJ4Gfrdac9Ua_QJ5FbQhB&index=1

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Patrick1612 , You can use isfiltered 

 

Meausre =

var _fil = calculate(isfiltered(Table[Date]), allselected(Table[Date]) )
return

if(_fil, countrows(filter(Table, Table[Indicator]= 1) ) , countrows(filter(Table, Table[Indicator]= 0) ) )

HasOneValue , Isfiltered: https://www.youtube.com/watch?v=hXg3kRFSGjA&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=38
https://youtu.be/cN8AO3_vmlY?t=10120

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak ,
thank you for your quick response. Your linked videos where helpful for some other tasks, but do not solve my current issue. As I wrote, I have created a measure in my report counting the IDs. However, I don't want to use it for the reasons written above. I want to use the implicit Power Bi measure Count for my fact table.

Unfortunately, I can't use a filter measure like yours in the filters pane as the value. To be more precisely, something like this:

Patrick1612_0-1739265535737.png

If this would be possible, it would solve my issue.
Do you have further ideas?

@Patrick1612 , Create on more Table with following Values

Indicator , Flag

1 , Yes

0, No

1, No

 

Join this with Indicator field of you table Many to Many, and filter direction from this new tables to your table.

 

Now use this new table in filter

 

All these videos in playlist uses same concept to solve different issues
https://www.youtube.com/watch?v=C9K8uVfthUU&list=PLPaNVDMhUXGYQJ4Gfrdac9Ua_QJ5FbQhB&index=1

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak ,
your ideas helped me a lot. Thank you! 🙂

Thanks for the reply from amitchandak , please allow me to provide another insight:

Hi, @Patrick1612 
Thanks for reaching out to the Microsoft fabric community forum.

Could you please let us know if amitchandak’s response resolved your issue? If it did, kindly accept it as the solution.

vlinyulumsft_0-1739775214711.png

To facilitate your understanding, I have created the following test data:

1.First, create a calculated table:

CalculationTable = 
DATATABLE (
    "Indicator", INTEGER,
    "Flag", STRING,
    {
        {1, "Yes"},
        {0, "No"},
        {1, "No"}
    }
)

2.Next, establish relationships between the two tables:

vlinyulumsft_1-1739775280636.png

 

3.Here's my final result, which I hope meets your requirements.

 

vlinyulumsft_2-1739775280637.png

vlinyulumsft_3-1739775290907.png

 

Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors