Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello. I would like to modify the following code snippet to refer to (2) cells in an Excel workbook (a cell for a start date and a cell for an end date)
Solved! Go to Solution.
You have loaded the data to power bi model right ? and if you are on live connection like direct mode then i think it will not load but only query it so try switching to import
another way is you could use what if parameter instead of the parameter table itslef i guess
Hi Could you try this
VAR __StartDate =
CALCULATE(
MAX('ParameterTable'[ParameterValue]),
'ParameterTable'[ParameterName] = "StartDate"
)
VAR __EndDate =
CALCULATE(
MAX('ParameterTable'[ParameterValue]),
'ParameterTable'[ParameterName] = "EndDate"
)
VAR __DS0FilterTable5 =
FILTER(
KEEPFILTERS(VALUES('Date Dim'[FiscalBaseDate])),
AND(
'Date Dim'[FiscalBaseDate] >= __StartDate,
'Date Dim'[FiscalBaseDate] < __EndDate
)
)
If the post helped please give a kudos and accept this as a solution
Thanks in advance
Hi - probably a dumb question, but where are you getting "Parameter Table" from?
Sorry didnt share that as you need to create a table for that Prameter Table for start date and end date which will then dynamically filter without hardcoding it into DAX
Ah ok...well, I tried adding your code and made a parameter table in the Excel workbook that contains the live connection data, but it just keeps telling me it cannot find the parameter table?
You have loaded the data to power bi model right ? and if you are on live connection like direct mode then i think it will not load but only query it so try switching to import
another way is you could use what if parameter instead of the parameter table itslef i guess
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Check out the July 2026 Power BI update to learn about new features.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.