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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ondrej_Bartak
Frequent Visitor

Identify order in which Field parameters items were selected?

I have a waterfall chart walking through from actual or forecast to budget - selection being done using field parameters. There is also variance drillthrough available. That variance however varies depending if I go forecast -> budget or budget -> forecast. 

 

When I add field parameter items to matrix as columns (selecting them), columns are added in order that I clicked individual field parameters. Is it possible to identify using DAX which was selected first and which was second? That way I could calculated variance mentioe

8 REPLIES 8
Anonymous
Not applicable

Same question, since field parameters preserve the order in which they were selected in a matrix visual, i wonder if there is a way to know what the first selection was. For my use case i need to let users select as many dimensions as they want to see. However, there is a Top option that basically by means of a measure discards rows that, grouped by the first field selected, fall outside defined top N values. 
My workaround for this issue was to create two identical field parameters, one of them will act as the "top N field" and the other one as the expansion dimension (working as any field parameter in a matrix).
However it would be awesome to be able to obtain this kind of users interactions data, since as far i know it's not  currently possible

ppezzuto68
New Member

Still waiting for solution. I want to make the right levels subtotals in a matrix And I've multiple selection as SEX,AGE,TYPE and people can select this to have rows grouping dynamic and I must calculate totals about every previous level. But I can't get the right selection order. Anyone found the solution ?

stenpede
New Member

Hi @Ondrej_Bartak@testprimest , did you find any solution for this? I am also looking for a solution in the same context. But in my case I would like to have a concatenated string of the selected values in a parameter.

Let say a have a parameter table, params, like this:

parameter= {
    ("Param1", NAMEOF('MyTable'[dim1]), 0),
    ("Param2", NAMEOF('MyTable'[dim2]), 1),
    ("Param3", NAMEOF('MyTable'[dim3]), 3)
}


If I selected in the follow order: first Param3, secondly Param1 but not selecting Param2, I would like to get a string back that is "Param3, Param1"

I am elaborating around something like the code below, but can not get it working as expected, I am getting the following error

"Column [parameter] is part of a composite key, but not all columns of the composite key are included in the expression or its dependent expression."

Measure_selected_params_ordered =
VAR __SelectedValue =
    SELECTCOLUMNS (
        SUMMARIZE ( 'params', 'params'[parameter] ),
        "ParamValue", 'params'[parameter]
    )

RETURN CONCATENATEX (
    ADDCOLUMNS (
        VALUES('params'[parameter]),
        "SelectedOrder", RANKX(__SelectedValue, 'params'[parameter], , ASC)
    ),
    ''params'[parameter],
    ", ",
    [SelectedOrder]
)

Getting a list of selected parameters, in the order stated in the parameter table, can be done like this:

Measure_selected_params =
VAR __SelectedValue =
    SELECTCOLUMNS (
        SUMMARIZE ('params', 'params'[parameter], 'params'[Parameter Fields]),
      'params'[parameter]
    )
RETURN CONCATENATEX ( __SelectedValue, 'params'[parameter], ", " )
Idrissshatila
Super User
Super User

Hello @Ondrej_Bartak ,

 

Yes you could add the number of which one is displaced first as the below example

Date Parameter = {
    ("Year", NAMEOF('Date'[Year]), 0),
    ("Quarter", NAMEOF('Date'[Quarter]), 1),
    ("Month", NAMEOF('Date'[Month]), 2),
    ("Day", NAMEOF('Date'[Day of Week]), 3)

}
 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thanks, but that defines order/grouping, right? What I need is know what was the click order, i.e. if I clicked/selected month first, then quarter in your example, than is should be month = 1 and quarter = 2.

I'm looking for the same solution too !! 

Also looking for this solution !

looking for the same solution

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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