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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Get slicer selected values in table

Hi everyone,

 

I would like to know if it is possible to get the values selected in a slicer and put them in a table ? 

 

In fact, I have a hirerarchical slicer with continents and for each continent a list of values. I would like to get the value selected for a continent and store it in a table, in order to join this table with my raw table. 

 

For example, in my raw table Africa has the value 100, Europe the value 500 and America 400. The user wants to change the values of africa and america.

ihoumel_0-1641822340264.png

He chose the value 2000 for africa and 3000 for america, I would like to have a column created next to each row with the values selected. I don't know if it is possible to achieve this ? 

 

Thank you 

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

Hi @Anonymous ,

Refer the below:

base data table:

vluwangmsft_0-1642062784551.png

Slicer:

vluwangmsft_1-1642062801269.png

Step 1,create measure on slicer:

Measure 2 = CALCULATE(SUM(Slicer[value]),FILTER(Slicer,Slicer[Name]=SELECTEDVALUE('Table'[Country])))

Step2,use the measure on base table:

valueqq = 
VAR _1 =
    EXCEPT ( ALL ( 'Table'[Country] ), ALLSELECTED ( Slicer[Name] ) )
RETURN
    IF (
        CALCULATE ( IF ( ISFILTERED ( 'Slicer'[Name] ), 1, 0 ), ALLSELECTED ( Slicer ) ) = 0,
        [maxvalue],
        IF (
            CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Country] IN _1 ) ) = 1,
            MAX ( 'Table'[value] ),
            [Measure 2]
        )
    )

Output result:

vluwangmsft_2-1642063034799.pngvluwangmsft_3-1642063085903.pngvluwangmsft_4-1642063095076.png

 

I provided my pbix if you need.

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


Best Regards

Lucien

View solution in original post

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Refer the below:

base data table:

vluwangmsft_0-1642062784551.png

Slicer:

vluwangmsft_1-1642062801269.png

Step 1,create measure on slicer:

Measure 2 = CALCULATE(SUM(Slicer[value]),FILTER(Slicer,Slicer[Name]=SELECTEDVALUE('Table'[Country])))

Step2,use the measure on base table:

valueqq = 
VAR _1 =
    EXCEPT ( ALL ( 'Table'[Country] ), ALLSELECTED ( Slicer[Name] ) )
RETURN
    IF (
        CALCULATE ( IF ( ISFILTERED ( 'Slicer'[Name] ), 1, 0 ), ALLSELECTED ( Slicer ) ) = 0,
        [maxvalue],
        IF (
            CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Country] IN _1 ) ) = 1,
            MAX ( 'Table'[value] ),
            [Measure 2]
        )
    )

Output result:

vluwangmsft_2-1642063034799.pngvluwangmsft_3-1642063085903.pngvluwangmsft_4-1642063095076.png

 

I provided my pbix if you need.

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


Best Regards

Lucien

Anonymous
Not applicable

Thank you very much @v-luwang-msft,

 

It is working really well 

Anonymous
Not applicable

Hi @amitchandak

Thank you for your reply ! But, i would like to display all the lines of my raw table and if a value is selected in the slicer get the new column filled by this value otherwise display nothing. 

 

Thanks 

amitchandak
Super User
Super User

@Anonymous , You can put them in visual table, by having the same column as un summarized field.

 

You can not use slicer values in a calculate table

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.