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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Changing multiple (two) field parameters with one button/slicer

Hi there!

Is it possible to change multiple (in my case two) field parameters using only one button/slicer in Power BI.

 

In my case, I am creating a sort of dynamic Sankey diagram with Weights and Source being dependent on two different field parameters relating to different timeframes. The Destination remains stable. 

Currently I have 2 different field parameters, see example below:

 

 

 

SankeyColumn_Parameter = {
    ("Timeframe 1", NAMEOF('Table1'[a]), 0),
    ("Timeframe 2", NAMEOF('Table1'[b]), 1),
    ("Timeframe 3", NAMEOF('Table1'[c]), 2)
}

SankeyCount_Parameter = {
    ("Timeframe 1", NAMEOF('_Measures'[SankeyCount_timeframe1]), 0),
    ("Timeframe 2", NAMEOF('_Measures'[SankeyCount_timeframe2]), 1),
    ("Timeframe 3", NAMEOF('_Measures'[SankeyCount_timeframe3]), 2)
}

 

 

 

 

If I set both field parameters to the same value (see picture), everything works fine.

robbertl_0-1664293484705.png


I however, would like to have 1 button/slicer that would set both field parameters to the corresponding values and not two separate slicers. 

 

Something like this (I do understand that this does not work at all, but maybe it helps clarify things):

 

 

 

SankeyCount_Parameter = {
    ("Timeframe 1", NAMEOF('_Measures'[SankeyCount_timeframe1]) && NAMEOF('Table1'[a]), 0),
    ("Timeframe 2", NAMEOF('_Measures'[SankeyCount_timeframe2]) && NAMEOF('Table1'[b]), 1),
    ("Timeframe 3", NAMEOF('_Measures'[SankeyCount_timeframe3]) && NAMEOF('Table1'[c]), 2)
}

 

 

 


Is this possible in some way? I was thinking of maybe using SWITCH( TRUE(), ) but not really sure how.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous !

I know this is a old topic, but I had the same problem, and your topic was top indexed on google, so I'll post how I solved it here, so it may help other people.
instead of using the code you thought of, you can use this one:

New_Parameter = {
    ("Timeframe 1", NAMEOF('Table1'[a]), 0, "TF 1"),
    ("Timeframe 2", NAMEOF('Table1'[b]), 1, "TF 2"),
    ("Timeframe 3", NAMEOF('Table1'[c]), 2, "TF 3"),
    ("Timeframe 1", NAMEOF('_Measures'[SankeyCount_timeframe1]), 3, "TF 1"),
    ("Timeframe 2", NAMEOF('_Measures'[SankeyCount_timeframe2]), 4, "TF 2"),
    ("Timeframe 3", NAMEOF('_Measures'[SankeyCount_timeframe3]), 5, "TF 3")
}


    

It will create a new column in the parameter, and you'll be able to put this new column on the segment, as will return only the group values.

It should work!





View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Hi @Anonymous !

I know this is a old topic, but I had the same problem, and your topic was top indexed on google, so I'll post how I solved it here, so it may help other people.
instead of using the code you thought of, you can use this one:

New_Parameter = {
    ("Timeframe 1", NAMEOF('Table1'[a]), 0, "TF 1"),
    ("Timeframe 2", NAMEOF('Table1'[b]), 1, "TF 2"),
    ("Timeframe 3", NAMEOF('Table1'[c]), 2, "TF 3"),
    ("Timeframe 1", NAMEOF('_Measures'[SankeyCount_timeframe1]), 3, "TF 1"),
    ("Timeframe 2", NAMEOF('_Measures'[SankeyCount_timeframe2]), 4, "TF 2"),
    ("Timeframe 3", NAMEOF('_Measures'[SankeyCount_timeframe3]), 5, "TF 3")
}


    

It will create a new column in the parameter, and you'll be able to put this new column on the segment, as will return only the group values.

It should work!





Perfectly elegant. Many thanks!

2 years later and this solution works great! thank you!!

Perfect Solution 🙂

Anonymous
Not applicable

Thanks a lot, was able to solve the issue with your advice.

Anonymous
Not applicable

Thanks for your reply. I am going to try this out and mark your answer as solution if it works :D.

Thanks again in any case since the question was still relevant and open for me 

v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

Best Regards,
Community Support Team _ kalyj

Anonymous
Not applicable

Hi, no not yet solved. trying to find a workaround myself. Will update here once applicable

Hi @robbertl is it solved? or did you get any workaround?

You can actually use indirection. The single Dimension Slicer below sets different parameters for 4 different visualisations. I'm also using it to dynamically set a title for the visualisation depending on the selection.

asorti6_0-1712314558432.png

asorti6_1-1712314714461.png

 

johnt75
Super User
Super User

If the timeframes are the same for each parameter you could maybe use a calculation group, with a calculation item for each timeframe, instead of a field parameter.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.