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, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
OmoigirlBI
Frequent Visitor

Filters with descriptions instead of codes

Good morning, I have a question, I want to make a filter by description instead of codes, that is, I have a table of countries where there are country codes and their corresponding name are matched, and then I have a report where only these codes are shown, but only 3 codes are used. If I would like to make a filter for these codes, but that appear their name, how would I do it, I can not find the way in the whole course.

1 ACCEPTED SOLUTION

Hi @OmoigirlBI 

You can create a measure.

Measure =
VAR a =
    SUMMARIZE (
        FILTER (
            MASTER - GEOGRAPHY,
            [GEOGRAPHY_CODE] IN VALUES ( 'MY REPORT'[GEOGRAPHY_CODE] )
        ),
        [GEOGRAPHY_DESCRIPTION_ES]
    )
RETURN
    IF ( SELECTEDVALUE ( MASTER - GEOGRAPHY[GEOGRAPHY_DESCRIPTION_ES] ) IN a, 1, 0 )

Then put the measure to the slicer visual filter and remove your code field 

vxinruzhumsft_0-1706672622294.png

Then it can only display the description.

 

Best Regards!

Yolo Zhu

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

5 REPLIES 5
OmoigirlBI
Frequent Visitor

Yessss!!! It´s working!!!

Thank you very much

Einomi
Helper V
Helper V

Hi,

Welcome !

Can you please put a screenshot of your data and also show us the desired outcome so that we can help 😀

Hi and thank you!!

I have two tables, one master of geographies, and another one with my report, they are related by geography_code, but i don't know how in my filter, use description instead of code of geography.

OmoigirlBI_1-1705931346232.png

 

I could only get this, but I need the description alone:

OmoigirlBI_0-1705935232649.png

 

Hi @OmoigirlBI 

You can create a measure.

Measure =
VAR a =
    SUMMARIZE (
        FILTER (
            MASTER - GEOGRAPHY,
            [GEOGRAPHY_CODE] IN VALUES ( 'MY REPORT'[GEOGRAPHY_CODE] )
        ),
        [GEOGRAPHY_DESCRIPTION_ES]
    )
RETURN
    IF ( SELECTEDVALUE ( MASTER - GEOGRAPHY[GEOGRAPHY_DESCRIPTION_ES] ) IN a, 1, 0 )

Then put the measure to the slicer visual filter and remove your code field 

vxinruzhumsft_0-1706672622294.png

Then it can only display the description.

 

Best Regards!

Yolo Zhu

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

 

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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.