Forum Discussion
3-column table with texts
- 3 years ago
Hi , Syndicate_Admin
Thanks for your quick response !
According to your description, you want to select in a slicer visual , and show the current month data and the previous data in two tables. Right?
Here are the steps you can refer to :
(1)This is my test data:
(2)We can click "New Table" to create a date table as a slicer :
Table 2 = ADDCOLUMNS( CALENDAR(FIRSTDATE('Table'[Date]), LASTDATE('Table'[Date])) , "year_month" , FORMAT([Date],"mmmm yy"))(3)Then we can create two measure :
Cur Momth = var _slicer =MIN('Table 2'[Date]) var _t =SELECTCOLUMNS( FILTER( ALLSELECTED('Table') , YEAR('Table'[Date])=YEAR(_slicer) && MONTH('Table'[Date])=MONTH(_slicer) ) ,"Datos",[Datos]) return IF( MAX('Table'[Datos]) in _t ,1, 0 )Previous Month = var _slicer = MIN('Table 2'[Date]) var _previous_month = EOMONTH(_slicer,-2)+1 var _t =SELECTCOLUMNS( FILTER( ALLSELECTED('Table') , YEAR('Table'[Date]) = YEAR(_previous_month) && MONTH('Table'[Date]) = MONTH(_previous_month)) ,"Datos" , [Datos]) return IF( MAX('Table'[Datos]) in _t ,1,0)(4)Then we can put the 'Table 2'[year_month] on the visual and we can configure the measure on the "Filter on this visual" and then we can meet your need:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you, but it's not what I'm looking for. I will try to give a "simpler" example to explain my situation.
Data:
And what I would like is something more or less like this...
For the selected month it is simple because it applies the filter directly, for the previous month I effectively used the interactions so that the filter of the slicer does not affect it, but what I can not do is dynamically the filter so that it brings me the information of the "previous month" to which it is selected.
I hope my need has become clearer.
Thanks a lot!