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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
olimilo
Continued Contributor
Continued Contributor

Use Slicer's selected value as a filter for a UNION calculated table

We have 3 calculated tables, Tables 01 and 02 references the data from CityGPS table while table 03 is supposed to combine the contents of 01 and 02 based on the single selected value of a slicer. However, Table 03 is only returning a blank table which I think is caused by the filter context - is there a way for us to use the slicer value as a filter for the UNION table? Does Table 01 and 02 being calculated tables (and not "actual" table) have any bearing to this?

 

olimilo_0-1740014946412.png

 

 

 

Tables
01 StartPoint = 
    SELECTCOLUMNS(
        CityGPS,
        "City", CityGPS[City],
        "Latitude", CityGPS[Latitude],
        "Longitude", CityGPS[Longitude],
        "Country", CityGPS[COUNTRY]
    )

02 EndPoint = 
    SELECTCOLUMNS(
        CityGPS,
        "City", CityGPS[City],
        "Latitude", CityGPS[Latitude],
        "Longitude", CityGPS[Longitude],
        "Country", CityGPS[COUNTRY]
    )

03 CombinedTable = 
    VAR StartCity = SELECTEDVALUE('01 StartPoint'[City])
    VAR DestinationCity = SELECTEDVALUE('02 EndPoint'[City])
    
    RETURN
        UNION(
            SELECTCOLUMNS(
                FILTER('01 StartPoint', '01 StartPoint'[City] = StartCity),
                "City", '01 StartPoint'[City],
                "Type", "Start City"
            ),
            SELECTCOLUMNS(
                FILTER('02 EndPoint', '02 EndPoint'[City] = DestinationCity),
                "City", '02 EndPoint'[City],
                "Type", "Destination City"
            )
        )

 

 

2 REPLIES 2
danextian
Super User
Super User

Hi @olimilo 

 

That is not possible. Calculated tables update when the underlying data or the formula itself has been modified or during a refresh. It isn't aware of any slicer selection.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
olimilo
Continued Contributor
Continued Contributor

Is there a different approach that can be done that would emulate the same result?

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors