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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Hannaalene
Frequent Visitor

search a column and returns another column value for filter/slicer

Hi, 

 

I am trying to implement a search function that give me a possiblity to search using one column and return the value of another column for report slicer.

Below is what I am trying to achive. that I would be able to search using Child column but get all rows that parent column that is linked to the child regardless of both child and parent are the same or not. I tried with LOOKUPVALUE but it didnt work as expected it only return one row

 

 

Hannaalene_1-1617912205983.png

 

 

 

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Hannaalene ,

 

Create a slicer table as below:

Slicer table = VALUES('Dimension Table'[Child])

Then create a measure as below:

measure =
VAR _parent =
    CALCULATETABLE (
        VALUES ( 'Dimension Table'[Parent] ),
        FILTER (
            ALL ( 'Dimension Table' ),
            'Dimension Table'[Child] IN FILTERS ( 'Slicer table'[Child] )
        )
    )
VAR _child =
    CALCULATETABLE (
        VALUES ( 'Dimension Table'[Child] ),
        FILTER ( ALL ( 'Dimension Table' ), 'Dimension Table'[Parent] IN _parent )
    )
RETURN
    CALCULATE (
        SUM ( 'Fact Table'[performance] ),
        FILTER (
            ALL ( 'Fact Table' ),
            'Fact Table'[Child]
                IN _child
                    && 'Fact Table'[Child] = MAX ( 'Fact Table'[Child] )
        )
    )

And you will see:

v-kelly-msft_0-1618219603073.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi  @Hannaalene ,

 

Create a slicer table as below:

Slicer table = VALUES('Dimension Table'[Child])

Then create a measure as below:

measure =
VAR _parent =
    CALCULATETABLE (
        VALUES ( 'Dimension Table'[Parent] ),
        FILTER (
            ALL ( 'Dimension Table' ),
            'Dimension Table'[Child] IN FILTERS ( 'Slicer table'[Child] )
        )
    )
VAR _child =
    CALCULATETABLE (
        VALUES ( 'Dimension Table'[Child] ),
        FILTER ( ALL ( 'Dimension Table' ), 'Dimension Table'[Parent] IN _parent )
    )
RETURN
    CALCULATE (
        SUM ( 'Fact Table'[performance] ),
        FILTER (
            ALL ( 'Fact Table' ),
            'Fact Table'[Child]
                IN _child
                    && 'Fact Table'[Child] = MAX ( 'Fact Table'[Child] )
        )
    )

And you will see:

v-kelly-msft_0-1618219603073.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

Hi @v-kelly-msft ,

 

thank you, it works when I only have one measure. when I mave multiple measures I am getting" visual exceeded available resource" message is there easier calculation the wont take much of a resource?

Hi  @Hannaalene ,

 

Sorry,this is the best solution I have thought of.☹️

 

 

Best Regards,
Kelly

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

 

amitchandak
Super User
Super User

@Hannaalene , of the expected option the best way one additional independent table

 

measure =
var _tab = allselected(dimension2[parent_id]) //based on child id selected we will get this
return
calculate(sum(Fact[performance]), filter(dimension, dimension[parent_id] in _tab))

 

 

refer my video, why you need this approach : Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.