Forum Discussion
stblonde
9 years agoRegular Visitor
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):...
- 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
v-ljerr-msft
9 years agoMicrosoft Employee
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
MarkyMark1
2 years agoAdvocate I
Hi how could I modify this to give a different rank when the dates are tied for the same campaign? I don't have access to the query editor to do a index for each row.