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
I am having below table
I wanted to create a bar graph with month on the x-axis and value on the y axis. I need to create a month name filter and whenever I select single month, it show the last three months on the bar graph
For example, If I select April, the bar grapjh shows Jan, Feb, March and April
I tried to replicate the other posts solution, but no success. Can anyone advise please?
Sample PBIX file attached here https://we.tl/t-kWAov94QkZ
Solved! Go to Solution.
Hi @bourne2000 ,
I updated your sample pbix file(see attachment), please check whether that is what you want.
1. Delete the relationship between Date and Sheet1
2. Create a measure as below to get the sum of value
Measure =
VAR _selyear =
SELECTEDVALUE ( 'Date'[Year] )
VAR _selmonth =
SELECTEDVALUE ( 'Date'[Month No] )
RETURN
CALCULATE (
SUM ( 'Sheet1'[Value] ),
FILTER (
'Sheet1',
'Sheet1'[Year] = _selyear
&& 'Sheet1'[Month] >= _selmonth - 3
&& 'Sheet1'[Month] <= _selmonth
)
)
Best Regards
Hi @bourne2000 ,
I updated your sample pbix file(see attachment), please check whether that is what you want.
1. Delete the relationship between Date and Sheet1
2. Create a measure as below to get the sum of value
Measure =
VAR _selyear =
SELECTEDVALUE ( 'Date'[Year] )
VAR _selmonth =
SELECTEDVALUE ( 'Date'[Month No] )
RETURN
CALCULATE (
SUM ( 'Sheet1'[Value] ),
FILTER (
'Sheet1',
'Sheet1'[Year] = _selyear
&& 'Sheet1'[Month] >= _selmonth - 3
&& 'Sheet1'[Month] <= _selmonth
)
)
Best Regards
Hi,
See if my solution here helps - Flex a Pivot Table to show data for x months ended a certain user defined month.
You may just import this workbook into PBI Desktop. In PBI Desktop, just go to File > Import > Power Query, PowerPivot and PowerView.
Take a look at this article that discusses what you are trying to accomplish.
https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/