Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Problem when creating a ranking using several tables in Power BI DAX

Hi team.   I'm trying to do this, for each couple year-month I need to create the ranking of my revenue. The rankin must restart everytime the year changes. This is an image of my model   A...
  • johnt75's avatar
    3 years ago

    Variables in DAX aren't really variables, they're constants, so the RevenuePerMonth variable is only calculated once, it is not recalculated for each year / month combination. 

    Take your code from the variable declaration and use it to create a new measure, and then reference that measure in your ranking code.