Dynamic M Query Parameters from Date Slicer Using Today Logic

I am trying to combine two different problems into a single solution but am unable to get to where I need to be.

The problem is we have daily CSV files from which we want to populate our report based on the selected date from a slicer. Upon opening the report, it should always default to the most recent file (which should typically be today), but the user should have the ability to select prior dates so they can view the data from that period of time.

I am using a date parameter in power query bound to the Date modified column of the table of CSV files. Thanks to the many resources I found, I have it working so that when a Date modified is selected from the slicer, the parameter is updated accordingly and the data from that day’s CSV file is used to populate the visuals.

The issue I am having is when I try to implement “today” logic into my slicer. Instead of using the Date modified column from my table, I created a calculated column which determines if the Date modified is today and displays as such, otherwise displays the date from the Date modified column. This is the only way I know to have the report always open to today (the actual requirement is to open to the latest date but this should suffice):

_Today = IF(Data_Lake_Files[Date modified] = TODAY(), “Today”, Data_Lake_Files[Date modified] & “”)

When I use this new column in my slicer instead of the Date modified, the Date modified value from the bound column does not pass to my parameter. I have a visual which shows just the Date modified and I can see it correctly gets updated based on the value I select in my slicer, but it doesn’t seem to pass to the bound parameter. Therefore, my data never updates.

I am looking for a solution as to how I can get both of these features to work together: dynamic M query parameters and defaulting report to today.

Unfortunately I am unable upload a PBIX file due to company restrictions. If needed, I can try to put something together at home and upload later, but I am hopeful my narrative is enough.

Thanks!

Hi @CraigS ,

You can check Data mentor Tool Advisor response at: