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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Selection based on rolling quarters

Hi Experts, I'm having a requirement, where I need to get all the rows with certain vendor in the current selection of quarter rolling back to last 5 quarters based on selected quarter.

DocumentPosting DateQuarterVendorAmountClearing Doc
D5347224349620191ABC442C311101621
D4867294349720191CVB850C237968269
D8221024352720191XYZ221C630671866
D8390654313420181ABC333C311101621
D5442934277020171ABC348C856864831
D1355514350120191POK94C218481646
D9527594313720181CVB65C965730315
D9267154277320171CVB928C664036872
D4058234350420191SDF780C102987470
D1288994354320191JKL206C726804533
D5096914314120181XYZ901C751616187
D8212724277720171XYZ282C676122956
D6675514314320181RTH101C842366235
D8308504314420181BHU948C626485659

So, when user selects Quarter 20191, from the drop down, it has to fetch rows which are in 20191 as below

D5347224349620191ABC442C311101621
D4867294349720191CVB850C237968269
D8221024352720191XYZ221C630671866
D1355514350120191POK94C218481646
D4058234350420191SDF780C102987470
D1288994354320191JKL206C726804533

and also the ones from last 5 quarters which have same vendors as of the vendors selected in 20191, but different clearing docs

D9527594313720181CVB65C965730315
D5096914314120181XYZ901C751616187

so the final result should be

D5347224349620191ABC442C311101621
D4867294349720191CVB850C237968269
D8221024352720191XYZ221C630671866
D1355514350120191POK94C218481646
D4058234350420191SDF780C102987470
D1288994354320191JKL206C726804533
D9527594313720181CVB65C965730315
D5096914314120181XYZ901C751616187

its more like pick all the vendors from the selected quarter look for matches in the previous 5 quarters and do a distinct count of clearing doc on window vendor, if its greater than 2 fetch else dont. I'm unable to do this in DAX.

Please help

Thanks.

1 REPLY 1
technolog
Super User
Super User

Can you please tell me if the problem is still relevant? If you managed to solve it in some way, please write here how you solved this problem. Then it will be possible to mark this problem as solved.

If not, it may make sense to ask the question again, thus confirming the relevance of this problem.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.