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.
Hello
Any ideas how i create a measure to show the previous month count.
Thanks
Ross
Solved! Go to Solution.
Hi @rosscortb,
I made one sample for your reference. Please check the following steps as below.
1. Create a date table, and create relationship between it and the fact table.
date = CALENDARAUTO()
2. To create the measure to get the amount of the previous month.
Previous = CALCULATE(SUM(Table1[headcount]),DATEADD('date'[Date],-1,MONTH))
Please check the pbix as attached.
Regards,
Frank
Hi @rosscortb
Please try this formula. COUNT can be replaced by SUM based on your data nature( if your coulmn already has count then you need to use sum)..
LastMonth Headcount=CALCULATE(COUNT(Table.column1),DATEADD(Dates[Date],-1,MONTH)
Thanks
Raj
Hi Raj
Thanks for your reply. I used your code but it returns the combined total of April to November?
Any ideas?
Ross
Is that we see your dataset (so one row per month) or you have an underlying date table with day-by-day data?
Hello,
I have head count table with a date column, dd/mm/yy and I have a calendar table that I created using the following link
https://kohera.be/blog/power-bi/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/
Thanks
Ross
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |