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
soumyakantibhar
Regular Visitor

How to select multiple values from a slicer and show it in visuals using DAX FUNCTIONS?

Screenshot (223).png

Hi,

I have written this code for 

calculating total sales.

-- 

Total Sales =

VAR CountryMultiple = [SelectedValue]
RETURN
CALCULATE( SUM(Table1[Sales]),
FILTER( Table1, Table1[Country ] in
{SELECTEDVALUE('Selection 1'[Country ]), CountryMultiple}))
 
and for "Selected Value" I have written this code
--  
SelectedValue = CONCATENATEX(ALLSELECTED ('Selection 2'[Country ]),'Selection 2'[Country ],", ")
 
First value should be from main country slicer and 2nd and so on will be from country slicer

How to select multiple values from

2nd slicer and show them in visuals?

 

Thank You

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @soumyakantibhar ,

 

Please refer this formula.

Measure = IF(SELECTEDVALUE(Table1[country]) = SELECTEDVALUE(selection1[country])||SELECTEDVALUE(Table1[country]) in VALUES(selection2[country]),SUM(Table1[sales]),BLANK())

vjaywmsft_0-1651048553300.pngvjaywmsft_1-1651048566798.png

 

Best Regards,

Jay

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @soumyakantibhar ,

 

Please refer this formula.

Measure = IF(SELECTEDVALUE(Table1[country]) = SELECTEDVALUE(selection1[country])||SELECTEDVALUE(Table1[country]) in VALUES(selection2[country]),SUM(Table1[sales]),BLANK())

vjaywmsft_0-1651048553300.pngvjaywmsft_1-1651048566798.png

 

Best Regards,

Jay

tamerj1
Super User
Super User

Hi @soumyakantibhar 

you may try

SelectedValue =
SELECTEDVALUE ( 'Selection 1'[Country ] ) & UNICHAR ( 10 )
    & CONCATENATEX (
        ALLSELECTED ( 'Selection 2'[Country ] ),
        'Selection 2'[Country ],
        UNICHAR ( 10 )
    )
amitchandak
Super User
Super User

@soumyakantibhar , try measure like


CALCULATE( SUM(Table1[Sales]),
FILTER( Table1, Table1[Country ] in allselected('Selection 1'[Country ])) )

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

Thank You for your reply.

Actually I have to show single country for selection1[Country] from main country slicer as first row of the table and secondly show multiple selection values from selection2[Country] in country slicer as second and third row of the table.

 

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.