The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Text a table with texts that I would like to show in 3 different columns (the columns have dates to make the separation in the columns). The visual 'Matrix' does not serve me so I thought to make 3 tables and that in one I filter the month I put in a slicer, in the other the previous month and in the third two previous months (compared to the month I put in the slicer).
With the table of the current month it is simple, but I can not find the way to do so that the other tables show what I want.
I leave a couple of images that I hope will serve to explain what I want.
Database:
Info in Power BI (after adding a couple of columns to have the date from the database):
and finally I leave what I would like to get in PBI with the filters I do.
If anyone has an idea of how to do this I will thank them, because I made a couple of attempts using the selectedvalue function in one measure, but in each record it gives me that it is selected so I can not filter anything.
Thank you very much for reading my order.
Best regards
gfellay (Gustavo)
Solved! Go to Solution.
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!
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
I will try to apply this solution and then come back to confirm the solution!
Thanks a lot!
Hi, @Syndicate_Admin
According to your description, do you want to use 3 slicers to filter 3 visuals separately?
If this , you can try to configure it in "Edit interaction":
For more information, you can refer to :
Change how visuals interact in a report - Power BI | Microsoft Learn
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
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |