Forum Discussion

Robin96's avatar
Robin96
Icon for Helper II rankHelper II
2 years ago
Solved

Calculate previous week measure doesnt work

Hey all, i have been having trouble with this dax for quite some time now.. and i really need to figure this out. 1. on the first week i want cash balance. IF(SELECTEDVALUE('date'[year_week]) ...
  • Mattiar's avatar
    2 years ago

    Hi Robin,

     

    first of all, i don't understand why you have that kind of relationships between tables. 

    You should have a star schema  with one directional among dimensions and facts.

    An advice i can give u, is try to use new calculation visual with its functions previous row.

    Otherwise you would have to construct a more complicated dax function where you could select the week you want on a TOPN function.
    For example, inside a variable you make yourself a SUMMARIZE in which you put the weeks in order. And if necessary you call up the week number with a SELECTEDVALUE.

  • Robin96's avatar
    Robin96
    2 years ago

    Hey Mattiar,

    Thanks for you response! The reason i have this kind of relationship is because this is just a "testing" report i made to understand and test these calculations. my actual report have a different kind of relation between tables.

    i will check out the new calculation visual and see if that will work any better, thanks!

    I would be happy if there is someone else here with an solution here also.