Dynamic Partitioning of Data

Dear All,

I want to partition the data based on user selection.
The following example resembles my output:

Employee Age will be selected by the user.
Visualization should show 2 results : Average Salary of Employees below the selected Age and Average Salary of Employees above the selected Age

I am new here, if anyone can point me to an existing post or can Sam’s videos or code help will be greatly appreciated.

Thank you

Hello Ramesh

Potentially you don’t need to partition the data but create a helper table (to contain the Employee Age option, amongst others).
Sam explains this concept in a number of videos, of which one comes to mind: Management Dashboard.

Please have a look (don’t be put off by the length of the video); Sam gets into it some five minutes from the beginning of the video.

The idea is to create a helper table (Home -> External Data -> Enter Data) and refer to it using the SELECTEDVALUE formula. From then, you can create another measure using the SWITCH formula.



It seems you most likely want to use a combination of what if parameters and then some additional logic into DAX measures.

The what if parameters will allow the user to a selection for age or salary.

From here you would just need to work out how to integrate the selection into your formulas.

Some combination of CALCULATE and FILTER will do this for you.

Also, I good course to go over where these are used extensively in a number of examples.