Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi All ,
As per business requirement i need to display last 3 months data as a stacked bar chart (because i am using region wise data as a legend) .I have data until May23 , so in the visual i need to showcase only Mar,April,May data only .
Using year slicer as well .. if i select 2022 , then the visual should give Oct,Nov and Dec data as per requirement .
I have data like below only .
Month | Year | Volume | Value (Func. Currency) |
APR | 2023 | 1.38 | |
APR | 2023 | 6.60 | |
FEB | 2023 | 1.30 | |
FEB | 2023 | 3.47 | |
JAN | 2023 | 1.05 | |
JAN | 2023 | 2.64 | |
MAR | 2023 | 1.61 | |
MAR | 2023 | 2.84 |
currently it is showing all 4 months as i am selected 2023 in year slicer .
Please help to fix this asap ?
thanks in advance
dinesh
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated table.
2. Create measure.
Flag =
var _select=
SELECTEDVALUE('Table 2'[Year])
var _column=
SELECTCOLUMNS(
FILTER(ALL('Table'),
'Table'[Year]=_select),"Month",[Month])
var _maxdate=
MAXX(
FILTER(ALL('Table 2'),
'Table 2'[Year]=_select&&'Table 2'[Month] in _column),[Date])
var _mindate=
EOMONTH(
_maxdate,-3)+1
var _include=
SELECTCOLUMNS(
FILTER(ALL('Table 2'),
'Table 2'[Date]>=_mindate&&'Table 2'[Date]<=_maxdate),"1",[Month])
return
IF(
MAX('Table'[Year])=_select&&MAX('Table'[Month]) in _include,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Anonymous thanks for your response ..
I have created the flag in my dashboard and applied the same but i got below error popup once flag filter applied ..
Please advise on this ?
Hi @Anonymous check Relative date type of fitler. I hope this help
Proud to be a Super User!