Forum Discussion
Using slicer to filter before appending two queries
- Anonymous2 years ago
Hi Anonymous
You can refer to the following solutions.
Sample data
1.In Power BI Desktop, create a slicer table. the table has no relationship with data table
Slicer = SUMMARIZE(FILTER('Table',[Current/Past]="Past"),[Attribute])2.Create the following measure
MEASURE = SWITCH ( SELECTEDVALUE ( 'Table'[Current/Past] ), "Current", CALCULATE ( SUM ( 'Table'[Value] ) ), CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Attribute] IN VALUES ( 'Slicer'[Attribute] ) ) ) )3.Then create a slicer and put the field of the slicer table to the slicer, and create a stacked bar chart table and put the measure and related field to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
You can refer to the following solutions.
Sample data
1.In Power BI Desktop, create a slicer table. the table has no relationship with data table
Slicer = SUMMARIZE(FILTER('Table',[Current/Past]="Past"),[Attribute])
2.Create the following measure
MEASURE =
SWITCH (
SELECTEDVALUE ( 'Table'[Current/Past] ),
"Current", CALCULATE ( SUM ( 'Table'[Value] ) ),
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', 'Table'[Attribute] IN VALUES ( 'Slicer'[Attribute] ) )
)
)
3.Then create a slicer and put the field of the slicer table to the slicer, and create a stacked bar chart table and put the measure and related field to the visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.