Forum Discussion

ShelRose's avatar
ShelRose
Frequent Visitor
2 years ago
Solved

Previous Month Dax not working

Hi, Im new to Power BI so looking for help.

Im trying to create a table to show current headcount, Previous Headcount and the difference between,by month. I also have a seperate filter with a month field. The previous  month Dax is working but when i Filter by month, example for August the table shows Augut Headcount figures and September previous month figures. I need it to show the month filtered and the previous month. 

PrevMonth= CALCULATE (count(headcount[count month]), PREVIOUSMONTH(Headcount[month][date]))

Any ideas what i am doing wrong? 

 

Thank you in advance 

  • Coud you telle us more about your tables and visuals you're using ?

    Most time intelligence functions requires a date table to work properly, do you have one ?

5 Replies

  • AilleryO's avatar
    AilleryO
    Icon for Memorable Member rankMemorable Member

    Hi,

    You should close your parenthesis after the COUNT function :

    PrevMonth= CALCULATE ( count( headcount[count month] ) , PREVIOUSMONTH( Headcount[month][date] ) )

    Hope it helps

    • ShelRose's avatar
      ShelRose
      Frequent Visitor

      Thansk AilleryO  it was just a typo on this post, i have it closed on my power bi, but still not working as hoped. thanks for the reply 🙂 

  • AilleryO's avatar
    AilleryO
    Icon for Memorable Member rankMemorable Member

    Coud you telle us more about your tables and visuals you're using ?

    Most time intelligence functions requires a date table to work properly, do you have one ?

    • ShelRose's avatar
      ShelRose
      Frequent Visitor

       

      Thats my table and FIlter. See the way Septemeber is showing when i only filter August. No i dont have a date table, i will create one and see if that works