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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello All
I have a table with the following columns
| Month | Usage | year |
Jul | 5645 | 2022 |
Agu | 1656 | 2022 |
Sep | 4465 | 2022 |
Oct | 456 | 2022 |
Nov | 46546 | 2022 |
Dec | 15 | 2022 |
Jan | 2165 | 2022 |
Feb | 546 | 2022 |
Mar | 3541 | 2022 |
Apr | 56 | 2022 |
May | 516 | 2022 |
Jun | 8996 | 2022 |
Jul | 265 | 2023 |
Agu | 1565 | 2023 |
Sep | 454 | 2023 |
Oct | 122 | 2023 |
Nov | 2165 | 2023 |
Dec | 5456 | 2023 |
Jan | 4654 | 2023 |
Feb | 57 | 2023 |
Mar | 74 | 2023 |
Apr | 75 | 2023 |
May | 754 | 2023 |
Jun | 5645 | 2023 |
Jul | 8785 | 2024 |
Agu | 74 | 2024 |
Now I have to show the past 12 months of data from the current month I am using bar chart to show this data
So now we are in the August so I have to show the Bars from August 2023 to August 2024
Solved! Go to Solution.
Hi @Anonymous ,
Consider a new date column:
Create a date table and a measure:
Model:
Measure:
Measure =
VAR _max_date = CALCULATE(MAX('Table'[Date]),ALL())
VAR _min_date = EOMONTH(_max_date,-13) + 1
VAR _cur_date = MIN('Date'[Date])
VAR _visual_filter = IF(_cur_date>=_min_date&&_cur_date<=_max_date,1)
RETURN
_visual_filter
Apply the measure to the visuals filter:
Output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @Anonymous ,
Consider a new date column:
Create a date table and a measure:
Model:
Measure:
Measure =
VAR _max_date = CALCULATE(MAX('Table'[Date]),ALL())
VAR _min_date = EOMONTH(_max_date,-13) + 1
VAR _cur_date = MIN('Date'[Date])
VAR _visual_filter = IF(_cur_date>=_min_date&&_cur_date<=_max_date,1)
RETURN
_visual_filter
Apply the measure to the visuals filter:
Output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
since you dont have an actual date and they are just text and year is number , it can be tricky but solvable
first add index to your table i npower query
next create a filetr measure
Filter Out =
VAR _t = TODAY()
VAR _tmy = FORMAT(_t, "mmm-yyyy")
VAR _i = CALCULATE(MAX('Table (2)'[Index]), ALL('Table (2)'), 'Table (2)'[Month] & "-" & 'Table (2)'[Year] = _tmy)
RETURN
IF( AND(MAX('Table (2)'[Index]) >=_i,MAX('Table (2)'[Index]) <=_i+12),1,0)
this measure will find when is today mont hand year and then return the index of this month-year then it will make a condition to return 1 if the indexes are in this range between todays month -year and after 12 months
add this emsaure to your filter panel
and let it be equal to 1
i would advise to make it easier by havng actual date format
and in case you have multiple duplicate month - year value , just use pwoer query make a new column called "Month-Year" combine them and then duplicate the table and remove duplicate values of month-year and just create a relationship between both tables
best regard
if i solved your question leave a thumbs up and accept as solution
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 39 | |
| 33 | |
| 25 |