Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have daily snapshots of detailed sales data. Over the 365 days, there are some days which the data is poor/empty. Our solution is to replace certain with other days. For example, if May 1 2019 is a bad date, pull rows for May 2 2019 and show them for the row for May 1 2019.
In summary: pull all sales history ... but if a record existed in the Replacement table, pull data for the Good Date instead of data for the Bad Date. This is a SSAS model, so if this can be a measure which performs this "smoothing" for any detail view - that would be ideal.
_goodDate =
LOOKUPVALUE (
DEV_Replacement_Dates[GoodDate],
DEV_Replacement_Dates[Location], MIN ( ORDER_HISTORY[Location] ),
DEV_Replacement_Dates[BadDate], MIN ( ORDER_HISTORY[AS_OF_DATE] )
)
_smoothedDollars =
IF (
ISBLANK ( [_goodDate] ),
SUM ( ORDER_HISTORY[Dollars] ),
SUMX (
FILTER ( ORDER_HISTORY, ORDER_HISTORY[AS_OF_DATE] = [_goodDate] ),
ORDER_HISTORY[AS_OF_DATE] = [_goodDate]
)
)
I would suggest you filter out your "bad" dates in the query (or at least flag them as such there), and then write DAX that looks for the given date, and returns the +/-1 day in the case it is blank (or flagged as "bad"). Would that work?
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.