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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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

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
Super User
Super User

@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

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

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