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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.