March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to replicate the LOOKUP formula in Excel that will return the Reporting Period End date for a date that falls between the Reporting Period Start Date and Reporting Period End Date. This is a fairly simple calc, but I have no idea how to do this in DAX. LOOKUPVALUE is not what I am looking for as it doesn't do greater than or equal two, that I know of. Workbook is below.
Solved! Go to Solution.
This is the formula I was looking for:
=
CALCULATE
(
VALUES
(
XREF_ReportingPeriods[Reporting Period End]
),
FILTER
(
XREF_ReportingPeriods,
[Date] >= XREF_ReportingPeriods[Reporting Period Start]
&&
[Date] <= XREF_ReportingPeriods[Reporting Period End]
)
)
This is the formula I was looking for:
=
CALCULATE
(
VALUES
(
XREF_ReportingPeriods[Reporting Period End]
),
FILTER
(
XREF_ReportingPeriods,
[Date] >= XREF_ReportingPeriods[Reporting Period Start]
&&
[Date] <= XREF_ReportingPeriods[Reporting Period End]
)
)
end date in the period : =
IF (
HASONEVALUE ( Dates[Date] ),
MAXX (
FILTER (
Periods,
MAX ( Dates[Date] ) >= Periods[Reporting Period Start]
&& MIN ( Dates[Date] ) <= Periods[Reporting Period End]
),
Periods[Reporting Period End]
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
I have tried this, after changing all the table names to match mine, but I cannot get it to work (all the values are blank). I am adding it to a calculated column to Table_Historical.
I am looking to add this as a calculated column called Reporting Period End Dtate in Table_Historical. Do you know how I can do this, using the same names I have used?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |