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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Fidzi8
Helper IV
Helper IV

Filter all ID by Haulier

Hi,
I need advice on how to filter.

I have this table and I need when I filter Haulier (ZEMPRA-HRDINA) so I can see all haulier at the destination (all ID Destination 3 and 5).

 2021-01-05_12h54_28.png

Thank you
Ondřej

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Fidzi8 

1. Create this measure:

 

ShowMeasure =
VAR ids_ =
    CALCULATETABLE (
        DISTINCT ( Table1[ID Destination] ),
        TREATAS ( DISTINCT ( Dim[Haulier] ), Table1[Haulier] ),
        ALLSELECTED(Table1)
    )
RETURN
    IF ( SELECTEDVALUE ( Table1[ID Destination] ) IN ids_, 1, 0 )

 

 2. Use the measure as filter for the visual, choosing to show when value of the measure is 1

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

5 REPLIES 5
AlB
Community Champion
Community Champion

@Fidzi8 

Can you share the pbix (with dummy data if necessary)?

By the way, you do not need to have ShowMeasure in the visual. It is enough if you place it as filter visual and select to show it when the value is 1

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

amitchandak
Super User
Super User

@Fidzi8 , Create Haulier  as an independent table for filter

Dim = distinct(Table[Haulier]) //use in slicer

 

Measure =

var _id = summarize(filter(Table, Table[Haulier] in values(Dim [Haulier])),Table[ID Destination])
return
calculate(countrows(Table), filter(Table, Table[ID Destination] in _id))

 

use this measure with other required columns

 

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

Thank you @amitchandak,

I created new table: Dim = distinct(Table[Haulier]) // and  I used in slicer
and I created measure but I don´t see other haulier at the destination.

 

vysledek.png

 

Thank you 
Ondřej

AlB
Community Champion
Community Champion

Hi @Fidzi8 

1. Create this measure:

 

ShowMeasure =
VAR ids_ =
    CALCULATETABLE (
        DISTINCT ( Table1[ID Destination] ),
        TREATAS ( DISTINCT ( Dim[Haulier] ), Table1[Haulier] ),
        ALLSELECTED(Table1)
    )
RETURN
    IF ( SELECTEDVALUE ( Table1[ID Destination] ) IN ids_, 1, 0 )

 

 2. Use the measure as filter for the visual, choosing to show when value of the measure is 1

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Thank you @AlB and @amitchandak,
Can I color separated by ID destination in PowerBI? 
barvy.png

Thank you
Ondřej

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!