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
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

4 REPLIES 4
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.

looking for the same solution

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.