Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ShelRose
Frequent Visitor

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 

1 ACCEPTED SOLUTION
AilleryO
Memorable Member
Memorable 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 ?

View solution in original post

5 REPLIES 5
ShelRose
Frequent Visitor

Hi @AilleryO  Date table worked 🙂 thank you for your help. 

AilleryO
Memorable Member
Memorable 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 ?

Power Bi.PNG

 

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 

AilleryO
Memorable Member
Memorable Member

Hi,

You should close your parenthesis after the COUNT function :

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

Hope it helps

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 🙂 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.