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
dan1234
Regular Visitor

Power Query - Logical Problem

Hi everyone,

I am posting a logical problem, hoping to get expert guidance.

Any thought in getting this solved is appreciated. I tried to attach the pbix file as well but I couldn't do that.

 

Current state

I have a data table like the one below:

 

dan1234_0-1668758643859.png

 

Several Initiatives get recorded daily from a Sharepoint list which describes the initiative's name and the Refresh date. The refresh date will be the same for all the initiatives at a point in time. It is the current date. This gets stored in the Data Table 1 View in Pbix.


I need to take a month-end snapshot of this view at the month's end, and it gets appended to the main data table. - Master Table

 

Initiative NameRefresh Date
aaa30/09/2022
bbb30/09/2022
cccc30/09/2022
dddd30/09/2022
eeee30/09/2022
ffff30/09/2022
ggg30/09/2022
hhh30/09/2022
iii30/09/2022
jjj30/09/2022
kkk30/09/2022
llll30/09/2022
mmm30/09/2022
nnn30/09/2022
ooo30/09/2022
pppp30/09/2022
qqqq30/09/2022
rrrr30/09/2022
sss30/09/2022
aaa31/10/2022
bbb31/10/2022
cccc31/10/2022
dddd31/10/2022
eeee31/10/2022
ffff31/10/2022
ggg31/10/2022
hhh31/10/2022
iii31/10/2022
jjj31/10/2022
kkk31/10/2022
llll31/10/2022
mmm31/10/2022
nnn31/10/2022
ooo31/10/2022
pppp31/10/2022
qqqq31/10/2022
rrrr31/10/2022
sss31/10/2022
aaa1/11/2022
bbb1/11/2022
cccc1/11/2022
dddd1/11/2022
eeee1/11/2022
ffff1/11/2022
ggg1/11/2022
hhh1/11/2022
iii1/11/2022
jjj1/11/2022
kkk1/11/2022
llll1/11/2022
mmm1/11/2022
nnn1/11/2022
ooo1/11/2022
pppp1/11/2022
qqqq1/11/2022
rrrr1/11/2022
sss1/11/2022

 

Proposed state

The ask is to create a slicer that helps to show only one month at a particular time, depending on the day. The data gets filtered based on that month.

i.e. if today is before the 15th of every month ( working day), the slicer should show prior to the prior month and if it is after 15th, it is the prior month. Ie on 01/11/2022, the Report refresh date date should show September 2022 initiative data, and if the day is after 15/11/2022, the report date slicer should be October 2022.


I have tried to create a column in the power query that achieve this but couldn't workout prior month and prior to prior month based on the 15th.

 

Proposed state.PNG

 

Can this be achieved?

 

 

2 ACCEPTED SOLUTIONS

Keep in mind that slicers need to be fed by columns. They cannot be fed by measures.

 

So either create a calculated table in DAX or a separate query in Power Query that lists the dates as needed.

 

As you may have realized already this only works in import mode with frequent (daily) dataset refreshes.

View solution in original post

Thank you, I will try that.

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Power BI has no memory, and no concept of global variables. You need to do that snapshotting  in the upstream system.

Thanks for checking this. I can do snapshotting upstream; it is the date selection that I couldn't work out. Sorry if that is not clear. I am stuck on how to get the prior month's and before the last month's data only to be seen in the one report view based on the 15th of every month. If we are before 15th of November then report should show September 2022 as the report date otherwise it is October 2022

Keep in mind that slicers need to be fed by columns. They cannot be fed by measures.

 

So either create a calculated table in DAX or a separate query in Power Query that lists the dates as needed.

 

As you may have realized already this only works in import mode with frequent (daily) dataset refreshes.

Thank you, I will try that.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.