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.
Hi All,
I would like to show value by month by city
(1) one month before
(2) same month last year
(3) same period year to that month and restart again new year start (ie. if it is Jun 2020, I like to sum from Jan to Jun 2020)
All the best,
Paris
Solved! Go to Solution.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi,
Try this:
Total volume = SUM(Data[volume])
Total volume in previous month = calculate([total volume],previousmonth(calendar[date]))
Total volume YTD = calculate([Total volume],datesytd(calendar[date],"31/12"))
Total volume YTD last year = calculate([Total volume YTD],sameperiodlastyear(calendar[date]))
Hope this helps.
Hi,
Try this:
Total volume = SUM(Data[volume])
Total volume in previous month = calculate([total volume],previousmonth(calendar[date]))
Total volume YTD = calculate([Total volume],datesytd(calendar[date],"31/12"))
Total volume YTD last year = calculate([Total volume YTD],sameperiodlastyear(calendar[date]))
Hope this helps.
Ashish,
Thank you very much for your reply.
I combined Allison and yours and it worked well. (sameperiodlastyear did not work in my sheet but the rest worked)
All the best,
Paris
You are welcome.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hello Allison,
Thank you for your reply.
I newly created DimDate from your link and tried PreviousMonth.
I got same month valuefor same city. but not previous month value. Is there anything I should check?
Thanks again.
All the best,
Paris
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi Allison,
Thank you very much for your reply. I tried both in column and measure and got the same result.
(I am using visual for measure)
Unfotunately, I am not able to share screen shot due to confidentiality.
Is there anyway I can do , perhaps without using DimDate?
Thank you again for your help.
All the best,
Paris
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi Allison,
Thank you so much for your reply again.
I set up DimDate and mark as date table and use your formula in measure.
I tried it with my sample data and here is my screen shot. Hope it helps to determin my error?
Thank you again.
All the best,
Paris
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi Allison,
Thank you for your patient and your advice. It worked when I set up relationship with two tables.
All the best,
Paris
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |