Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
binayjethwa
Helper V
Helper V

Get data for previous 8(Current + Previous 7 quarters) data based on slicer selection

Hi,

 

I want to show the line chart which shows the last 8 quarters of data ( selected quarter + previous 7 quarters data) based on slicer selection.

 

I have a simple data table without date field.

 

For example if i select 2022 , Q4 , i shoud see data for 2022 Q4,Q3,Q2,Q1, 2021 Q4,Q3,Q2,Q1.

 

Can someone suggest here please. Thanks in advance.

 

My slicers contain below values 

binayjethwa_1-1678786545879.png

 

binayjethwa_0-1678786396998.png

Thanks,

Binay

6 REPLIES 6
binayjethwa
Helper V
Helper V

Hi @Ahmedx  ,

Are those Year and Quarter slicers are taken from DimYear and DimQuarter tables ?

If it is taken from those disconnected tables , how can i get other KPIS to get filtered out since there are other KPIS on the page which gets filtered based on slicer selection.

 

alternatively, you can create a dotted link.
in some way it is not necessary to activate, but in others it will be necessary to tweak the function for this
USERELATIONSHIP

Screen Capture #594.png

Ahmedx
Super User
Super User

1) We need to create a column (Index)
1.png
2) also need to create two unrelated tables
2.png3.png
3) need to correctly insert slicer and matrix columns

4.pngScreen Capture #591.png
4) create measure
6.png

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26Rhj6wb7rJPiGmynJB?e=vWbuxT

Hi I have used it for showing a measure values in a matrix visual where some quarters data is is missing ,is this work for measures also.

Thanks in Advance

 

binayjethwa
Helper V
Helper V

Hi @amitchandak ,

 

I do not have any date field in my model , i Just have a Quarter and Year slicer separately , and based on selection i need to show my calculations for 8 previous quarters.

amitchandak
Super User
Super User

@binayjethwa , if you select 1 value and want to show more than that, then you need slicer of independent date /qtr table

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -24) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.