Forum Discussion

Jay12's avatar
Jay12
New Member
3 years ago

Dax

I have an issue:

I have:

1. IDs (this contains nvarchar ID)

2. Stage (This is the stage of each ID at different dates)

3. Import_Date: This is a date value for all ID.

 

I want to create dax measures for a visual:

2 separate date filters for Import_Date

 

A visual to show:

In column A: IDs

In column B: Early Stage only (This should contain only data for the minimum user selected date)

 

In column C: Later Stage only (This should contain only data for thr maximum user selected Date).

 

 

Basically, I want to view only data for the selected dates, not before or after the date. 

 

Example, if a user selects 6/10/2022 and 13/1/2023, the visual will show this pattern. 

ID-440 || Stage_7 || Stage_9

1 Reply

  • Jay12 , Based on what I got a new column

     

    Next =

    var _min = minx(filter(Table , [ID] = earlier([ID]) && [Import Date] > earlier([Import Date]) ), [Import Date])

    return

    minx(filter(Table , [ID] = earlier([ID]) && [Import Date] =_min ), [Stage])

     

    previous=

    var _max = maxx(filter(Table , [ID] = earlier([ID]) && [Import Date] < earlier([Import Date]) ), [Import Date])

    return

    minx(filter(Table , [ID] = earlier([ID]) && [Import Date] =_max ), [Stage])

     

    Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8