Forum Discussion

stblonde's avatar
stblonde
Regular Visitor
9 years ago
Solved

DAX: Ranking Date

Hello everyone,    I have some  trouble with Power BI and I hope you will help me with. I have a list of Campaigns from Campaign 1 to 4 with the communication date in front, see below (picture 1):...
  • v-ljerr-msft's avatar
    v-ljerr-msft
    9 years ago

    Hi stblonde,



    I tried your first solution, but it showed up an Error (The column "date" cannot be found) :smileysad:

    You shouldn't leave the VAR Function (DAX) in your formula. The formula below is for your reference.:smileyhappy:

    Rank =
    VAR d = Tableau1[Date]
    VAR c = Tableau1[Campaign ID]
    RETURN
        CALCULATE (
            RANK.EQ ( d, Tableau1[Date], ASC ),
            FILTER ( ALL ( Tableau1 ), Tableau1[Campaign ID] = c )
        )

    And the formula above should also meet your requirements:

     

     

    Here is the sample pbix file for your reference.

     

    Regards