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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gui_Gon
New Member

Slicer: Multiple selection

Hi all,

 

I'm working on a report and am finding some trouble to show some import/export data with multiple filter selection. 

 

For instance: We have country 1, 2 and 3:

Country 1 exports to country 2 and country 2 exports to country 3.

 

I'd like to display different sums imports and exports in a graph so, for example, if I select:

 

Country 1 -> Display demand from country 1 and export volumes for country 2

Country 2 -> Display demand from country 2 and import volumes from country 1 and export volumes to country 3

Country 3 -> Display demand from country 3 and import volumes from country 2

Countries 1 & 2 -> Display demand from countries 1 and 2 and export volumes to country 3

Countries 1 & 3 -> Display demand from countries 1 and 3 and export volumes to country 2 and imports from country 3

Countries 2 & 3 -> Display demand from countries 2 and 3 and import volumes from country 1

Countries 1 & 2 & 3 -> Display only the demand from countries 1, 2 and 3

 

Summing up, I'd like to know how can I sum different numbers based on different selections. So, how can I program Power BI to sum export volumes from country 1 only when only country 1 is selected or only countries 1 and 3 are selected together but do not sum this data with other selections.

 

Do you think you can help me?

Many thanks in advance,

Guilherme

2 ACCEPTED SOLUTIONS

Hi Raj,

 

Thank you for your answer, but I didn't unsderstood how can I do it. In the scenario I've mentioned, I'd have only 3 measure names (country 1, country 2 and country 3), however the fields that I intent to sum is different based on the selection that I can make.

 

PBI sample.png

 

Does that make sence?

 

Thanks,

Guilherme

View solution in original post

Anonymous
Not applicable

1. Create DAX table)Ex: Table_Dax) with 1 column

 

Prompt_Values

=========

Country1

Country2

Country3

Country1&2

Country2&3

Country1&3

Country1&2&3

 

2. Create a slicer based on Table_DAX. Prompt_values

3. Create Measure like this:

 

Measure1=SWITCH( SELECTEDVALUE(Table_DAX[Prompt_values]),

"Country1", <your calculation>,

"Country2",<your calculation>,

"Country3",<your calculation>,

"Country1&2",<your calculation>,

"Country1&3",<your calculation>,

"Country2&3",<your calculation>,

"Country1&2&",<your calculation>

)

 

Hope this helps.

 

Thanks

Raj

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You will have to create a DAX table by entering the values. The DAX table will have 2 column, one is with the measure name that you want to display and another column(Say ColA) you can give some meaningful value.

 

Your slicer should be based on the ColA column values and based on the selection, you can use the measure dynamically. you need to use SELECTEDVALUE function for this.

 

Thanks

Raj

Hi Raj,

 

Thank you for your answer, but I didn't unsderstood how can I do it. In the scenario I've mentioned, I'd have only 3 measure names (country 1, country 2 and country 3), however the fields that I intent to sum is different based on the selection that I can make.

 

PBI sample.png

 

Does that make sence?

 

Thanks,

Guilherme

Anonymous
Not applicable

1. Create DAX table)Ex: Table_Dax) with 1 column

 

Prompt_Values

=========

Country1

Country2

Country3

Country1&2

Country2&3

Country1&3

Country1&2&3

 

2. Create a slicer based on Table_DAX. Prompt_values

3. Create Measure like this:

 

Measure1=SWITCH( SELECTEDVALUE(Table_DAX[Prompt_values]),

"Country1", <your calculation>,

"Country2",<your calculation>,

"Country3",<your calculation>,

"Country1&2",<your calculation>,

"Country1&3",<your calculation>,

"Country2&3",<your calculation>,

"Country1&2&",<your calculation>

)

 

Hope this helps.

 

Thanks

Raj

 

Anonymous
Not applicable

Hi Raj,

 

I followed the same senario for that multi selection in the slicer. but i am not able to select the multiple selections like. column1 and column2 and column3 at single selection.....

 

Can yopu please help me on this.....

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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