The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi There,
I have to create a measure that selects the first date in a column (measurementnextdate) that is after the the first date in a slider (AA MinDate) for each Covenant ID.
So if if the date in the slider is 30/09/2020 I want to only return the rows marked in red:
This is the dax that I used:
But it is not working.
Your code and data don't really match, but the solution could be simple. Once you do a "SUMMARIZE", if you refer to that table you should be able to just refer to the column itself:
AA Next MDate =
VAR FirstMeasurementDate = [AA MinDate]
VAR DatesGreaterThanValueDate =
FILTER (
SUMMARIZE (
VwCovenant,
VwCovenant[Measurementnextdate],
VwCovenant[CovenantID]
),
[Measurementnextdate] > FirstMeasurementDate //Code change 1
)
VAR NextImmediateDate =
MINX ( DatesGreaterThanValueDate, [Measurementnextdate] ) //Code change 2
RETURN
NextImmediateDate
If this doesn't work, can you share your pbix wit sensitive data removed? Otherwise please define [AA Min Date], make sure your data matches up with your code, and provide data in a format that can be easily copied.
Hope this helps
David
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |