Forum Discussion
Comparison between 2 Categories with Dynamic Slicers
- 6 years ago
Hi Anonymous ,
We can create two slicers based on two new tables and three measures to meet your requirement.
1. Create two new tables just containing the distinct period.
Slicer 1 = DISTINCT('Table'[Period])Slicer 2 = DISTINCT('Table'[Period])2. Create three measures and put them to a table visual.
QPA1 = var _selected = SELECTEDVALUE('Slicer 1'[Period 1]) return CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[Period]=_selected))QPA2 = var _selected = SELECTEDVALUE('Slicer 2'[Period 2]) return CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[Period]=_selected))Observation = IF( ISBLANK([QPA2]),"PN Deleted", IF( ISBLANK([QPA1]),"PN added", IF( [QPA1]<[QPA2],"QPA Increased","QPA Decreased")))If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , You need to two period tables. One can be connected. And then refer this blog. Here I have used the date range. You can use period value. In place on Min and Max and use only Max. And filter = max value
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601