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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
netanel
Post Prodigy
Post Prodigy

Previous month Not working for me

Hey All!

 

A bit of a weird problem
In a lot of projects I did a month less last month
The formula works great
Just here it does not work for me.


I have a FACT table and a DIM DATE table
that's it
And the Measure are:

Count Person Num = DISTINCTCOUNT('Data HC'[Person Number])   
(Which brings me to the number of people in the organization)
 
Previous month = CALCULATE([Count Person Num],DATEADD('Date'[Date],-1,MONTH))
(That should bring me the previous month but something is wrong with it)
Can you understand why?
She's currently bringing me the same number for the current month
 
Thanks!
 







Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Sounds like only a rookie's mistake. Even if your measure uses previous month as date filter, any other existing date filters in the viz/matrix need to be taken into consideration.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

Sounds like only a rookie's mistake. Even if your measure uses previous month as date filter, any other existing date filters in the viz/matrix need to be taken into consideration.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

@CNENFRNL 

shame on me

 

I played so much with the data
That I did not look at this little thing

Thanks!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
mh2587
Super User
Super User

try this instead of dateadd:
PREVIOUSMONTH(<dates>)


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



@mh2587 

its bring me blank
But I really want to know why it's not going my way
I'm sure I'll find something








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.