Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a problem with Power BI, i want to select 3 months in a row
Exemple : When clicking to the Segment "June 2024" , i want display on a table the values for June, July and August. I want to work with months.
I tried with create a new table of table with this but it doesn't work
Selected Month=
VAR MinDate = SELECTEDVALUE(Date[Month])
VAR MaxDate = SELECTEDVALUE(Date[Moonth])+3
VAR CurrentDate = SELECTEDVALUE(Table(Month))
Return IF(CurrentDate<=MaxDate && CurrentDate >= MinDate,1)
Please someone can help me ?
Solved! Go to Solution.
Hi , @Kingnico63000
According to your descritption, you want to "Show the 3 next month when selecting a date".
Here are teh steps you can refer to :
(1)This is my test data:
(2)We can click "New table" to create a date table and we do not need to create any realtionship between two tables:
Date = ADDCOLUMNS( CALENDAR(EOMONTH( FIRSTDATE('Table'[Date]),-1)+1 , EOMONTH(LASTDATE('Table'[Date]),3)) , "Year_month" , FORMAT([Date],"yyyy-mm"))
(3)Then we can create a measure like this:
Measure = var _slicer_date = MAX('Date'[Date])
var _first_date = EOMONTH(_slicer_date,-1)+1
var _last_date = EOMONTH(_slicer_date,2)
var _cur_date = MAX('Table'[Date])
return
IF(_cur_date>= _first_date && _cur_date <= _last_date ,1,0)
(4)Then we can put the measure on the "Filter on this visual" and then we can meet your need:
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
Hi , @Kingnico63000
According to your descritption, you want to "Show the 3 next month when selecting a date".
Here are teh steps you can refer to :
(1)This is my test data:
(2)We can click "New table" to create a date table and we do not need to create any realtionship between two tables:
Date = ADDCOLUMNS( CALENDAR(EOMONTH( FIRSTDATE('Table'[Date]),-1)+1 , EOMONTH(LASTDATE('Table'[Date]),3)) , "Year_month" , FORMAT([Date],"yyyy-mm"))
(3)Then we can create a measure like this:
Measure = var _slicer_date = MAX('Date'[Date])
var _first_date = EOMONTH(_slicer_date,-1)+1
var _last_date = EOMONTH(_slicer_date,2)
var _cur_date = MAX('Table'[Date])
return
IF(_cur_date>= _first_date && _cur_date <= _last_date ,1,0)
(4)Then we can put the measure on the "Filter on this visual" and then we can meet your need:
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
Hello, i want a dynamic filter,
When click on the segment "June" i have June, July and August
And after, when click on "Septembre", display September, October and December
Hi Kingnico63000
have you tried the report filter options avalibale on power BI
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |