Forum Discussion
Farwest
6 years agoFrequent Visitor
Dynamic max calcuation in Power Query
Hi, I am trying to calcualte a dynamic Max value from one column in Power Query Editor. An example below where I have different groups, I would like to be able to have dynamic Max value measurem...
Farwest
6 years agoFrequent Visitor
Thank you for the answer,
I managed to get out of this problem.
I am still struggling with some other dynamic calculations.
I am trying to use a filter in order to set a measure, it is a single selection filter.
Selected = if(HASONEVALUE('Table['Name]);SELECTEDVALUE('Table[Name]);"ALL")
I am getting the selected filter through this and using switch to select a column based on the selection
SWITCH([Selected];
"ALL";MAX(Table[Sales 1]);
MAX(Table[Sales 2]))
here I would like to use a column if nothing is selected (Table[Sales 1]) and the other column (Table[Sales 2]) for any single selection filter. it does not look to be working as "ALL" is not in Table[Name]. is there a workaround for this.
Please let me know if I must create a new topic for this
Thanks,
Farwest
6 years agoFrequent Visitor
Dear Community,
I am still struggling with the filter selection,
I created a measure to get the selected value or get "ALL" instead
Selected = if(HASONEVALUE('Table'[Tool Name]);SELECTEDVALUE('Table'[Tool Name]);"ALL")
Measure = SWITCH([Selected];
"ALL";MAXX('Table'[Result 1]);
MAX(''Table'[Result 2]))
Does not seem to swith, I always have the same column returned.
Thanks.