Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Currently i have a date table that populates from 10/31/2019 to current date and has a column for EOMonth; This is a 0/1 value and has 1 for the most current day of the month. So 2/17 will have a 1 today, tomorrow 2/18 will be 1, until the end of the month.
I want to compare the current day value to last month, and two months ago. How could i do this?
For example i want to compare today's value to Jan 31 and December 31, but i also want to compare Jan 31 value to December 31 and Nov 30 value.
Thank you for the help.
Hi @thampton ,
You can refer to this thread:https://community.powerbi.com/t5/Desktop/Current-Month-Previous-Month-and-Before-Previous-Month/m-p/...
If the problem persists,could you please share sample data and expected results?
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
In case you have date dimension you can try like
CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-2,Month))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin
So you would want to do something along the lines of:
Measure =
VAR __Month = MONTH(TODAY())
VAR __1MonthAgo = MAXX(FILTER('Dates'[Date],MONTH([Date]) = __Month - 1 && [EOMonth] = 1),[Date])
VAR __2MonthAgo = MAXX(FILTER('Dates'[Date],MONTH([Date]) = __Month - 2 && [EOMonth] = 1),[Date])
...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |