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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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