Forum Discussion
Select a column by parameter
- 8 years ago
Anonymous wrote:
Thanks for the disconnected slicer information. But I think the main difference is that I hope to filter by columns but the disconnected slicer filters data by rows. Still thanks for your information.
Anonymous
In my opinion, a better practice for your case is to unpivot the columns and slice the unpivoted column.
If the way in your original post is still preferable, you could try to create measure as
Cumulative Freezer = SWITCH ( TRUE (), HASONEVALUE ( ParameterTable[Parameter] ) && ISFILTERED ( ParameterTable[Parameter] ) && LASTNONBLANK ( ParameterTable[Parameter], "" ) = "Freezer", CALCULATE ( SUM ( 'Business Plan'[Freezer] ), FILTER ( ALL ( 'Business Plan'[Period] ), 'Business Plan'[Period] <= MAX ( 'Business Plan'[Period] ) ) ), HASONEVALUE ( ParameterTable[Parameter] ) && ISFILTERED ( ParameterTable[Parameter] ) && LASTNONBLANK ( ParameterTable[Parameter], "" ) = "Washing machine", CALCULATE ( SUM ( 'Business Plan'[Washing machine] ), FILTER ( ALL ( 'Business Plan'[Period] ), 'Business Plan'[Period] <= MAX ( 'Business Plan'[Period] ) ) ), 0 )
Thanks for the disconnected slicer information. But I think the main difference is that I hope to filter by columns but the disconnected slicer filters data by rows. Still thanks for your information.
Anonymous wrote:
Thanks for the disconnected slicer information. But I think the main difference is that I hope to filter by columns but the disconnected slicer filters data by rows. Still thanks for your information.
Anonymous
In my opinion, a better practice for your case is to unpivot the columns and slice the unpivoted column.
If the way in your original post is still preferable, you could try to create measure as
Cumulative Freezer =
SWITCH (
TRUE (),
HASONEVALUE ( ParameterTable[Parameter] )
&& ISFILTERED ( ParameterTable[Parameter] )
&& LASTNONBLANK ( ParameterTable[Parameter], "" ) = "Freezer", CALCULATE (
SUM ( 'Business Plan'[Freezer] ),
FILTER (
ALL ( 'Business Plan'[Period] ),
'Business Plan'[Period] <= MAX ( 'Business Plan'[Period] )
)
),
HASONEVALUE ( ParameterTable[Parameter] )
&& ISFILTERED ( ParameterTable[Parameter] )
&& LASTNONBLANK ( ParameterTable[Parameter], "" ) = "Washing machine", CALCULATE (
SUM ( 'Business Plan'[Washing machine] ),
FILTER (
ALL ( 'Business Plan'[Period] ),
'Business Plan'[Period] <= MAX ( 'Business Plan'[Period] )
)
),
0
)- Anonymous8 years agoNot applicable
Thank you! I think unpivot columns are suitable for my case and thank you for the code I will also try!