Forum Discussion
Dynamic Column calculation based on Slicer multiple selection
- Anonymous8 years ago
I find a help as a part of the solution in this post by applying the provided formula like this (it is an example) :
After Loss Date = CALCULATE(SUM(CashFlows[CashFlow])*(1-[Loss_Select]), FILTER(ALLSELECTED(CashFlows),CONTAINS(ALLSELECTED(DimDeals),DimDeals[Deal_Index],CashFlows[Deal_Index])), FILTER(ALL(CashFlows),[Deal_Index]=MAX([Deal_Index])&&CashFlows[Date]>[Date_Loss_Select]))
Contains seems to be help a lot.
The only remained thing is that a slicer can not apply accross reporting
I carry on digging this point.
Regards,
Ph
Hi,
It use the parameter table pattern below:
To get the selected value, use the VALUES function in the measure that uses the parameter. Usually you check the selection of one value only. If the selection is of all the parameters, it is like there is no selection at all and, in this case, you can return a default value. If the selection has more than one but not all parameters, you might consider this case as a multiple selection, which in most cases may be an invalid selection. The following code represents the complete pattern that you see applied later in more pattern examples.
1 2 3 4 5 6 7 8 9 10 | ParameterSelection := IF ( HASONEVALUE ( Parameter[ParameterValue] ), "Selection: " & VALUES ( Parameter[ParameterValue] ), IF ( NOT ( ISFILTERED ( Parameter[ParameterDescription] ) ), "No Selection", "Multiple Selection" ) ) |
Link from:
http://www.daxpatterns.com/parameter-table/
Regards,
- Anonymous8 years agoNot applicable
Hi Thyago_Rezende,
Thanks for your answer. I read the article, yet, I don't find which function to use in the case of "Multiple Selection" to fill selected data in column.
In few words, I just want to create a second column with "1" if the data of first column are selected, 0 then.
Thanks for help.
Regards
Ph
- Thyago_Rezende8 years agoResolver I
Did you try to create roles? Manage rules?
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-rls/
Maybe this help you.
Best regards,
- Anonymous8 years agoNot applicable
I find a help as a part of the solution in this post by applying the provided formula like this (it is an example) :
After Loss Date = CALCULATE(SUM(CashFlows[CashFlow])*(1-[Loss_Select]), FILTER(ALLSELECTED(CashFlows),CONTAINS(ALLSELECTED(DimDeals),DimDeals[Deal_Index],CashFlows[Deal_Index])), FILTER(ALL(CashFlows),[Deal_Index]=MAX([Deal_Index])&&CashFlows[Date]>[Date_Loss_Select]))
Contains seems to be help a lot.
The only remained thing is that a slicer can not apply accross reporting
I carry on digging this point.
Regards,
Ph