Forum Discussion
Using a slice selection for measure but not for filtering
Hi,
I am working with a power Bi that consists on comparing the user data from one month to the previous one. To do this, i can't use a slice to make the user choose the month because then i have to options:
- if I allow the slice to filter the visual object, I don't have the data from the previous month of the selected one (for exemple if user select april, I can't show the comparision with march because data is filtered only by march).
- If I don't filter the visual object by the slice but I use the value selected with the SELECTEDVALUE() function, it doesn't take it because it is not filtered by it.
If thought in using two slices, that the one depending in the other (it could be that the segond filter took the previous month to the one selected in the first slice or something like this).
If you guys have some ideas on it I would be very thankful.
Kind regards,
Marc
Anonymous , Please check if the new field parameters can help
Field Parameters- One solution for Measure Dimension slicer: https://youtu.be/lqF3Wa1FllE?t=70
also check
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKAHi Anonymous ,
According to your description, you said that if you allow the slicer to filter the visual, you don't have the data from the previous month of the selected one. But if you create a measure to show the previous month data, it can also work fine with the slicer.
I create a sample.
Here's my solution, create a measure.
Pre = VAR _Pre = DATEADD ( 'Table'[Date], -1, MONTH ) RETURN CALCULATE ( MAX ( 'Table'[Sales] ), FILTER ( ALL ( 'Table' ), 'Table'[Date] = _Pre ) )Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
According to your description, you said that if you allow the slicer to filter the visual, you don't have the data from the previous month of the selected one. But if you create a measure to show the previous month data, it can also work fine with the slicer.
I create a sample.
Here's my solution, create a measure.
Pre = VAR _Pre = DATEADD ( 'Table'[Date], -1, MONTH ) RETURN CALCULATE ( MAX ( 'Table'[Sales] ), FILTER ( ALL ( 'Table' ), 'Table'[Date] = _Pre ) )Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amitchandakSuper User
Anonymous , Please check if the new field parameters can help
Field Parameters- One solution for Measure Dimension slicer: https://youtu.be/lqF3Wa1FllE?t=70
also check
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA