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.
I have the following table:
CodSale | Sold | Date |
1 | 125 | 2018-05-10 |
2 | 100 | 2018-05-15 |
3 | 150 | 2018-05-20 |
4 | 50 | 2018-06-20 |
5 | 75 | 2018-06-25 |
I need to make a measure that returns me the following table:
Month | SoldLastMonth |
May | 0 |
Jun | 375 (Sum of sales May) |
Ago | 125 (Sum of sales Jun) |
I tried to use PREVIOUSMONTH and EDATE(Date; -1) but doesn't work.
I will use this measure on a graph to see "Month Over Month".
Solved! Go to Solution.
Have you got a Date table? Time intelligence functions are only guaranteed to work if you have a "complete" Date table.
If you don't, create one, place Month in rows of a matrix visual and this measure in values for the previous month sales:
SoldPreviousMonth = CALCULATE ( SUM ( CodSales[Sold] ); PREVIOUSMONTH ( CalendarTable[Date] ) )
in order to be able to use TIME INTELLIGENCE functions, you need to create a date dimension and link it to the fact tables:
http://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-3-public-holidays
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Have you got a Date table? Time intelligence functions are only guaranteed to work if you have a "complete" Date table.
If you don't, create one, place Month in rows of a matrix visual and this measure in values for the previous month sales:
SoldPreviousMonth = CALCULATE ( SUM ( CodSales[Sold] ); PREVIOUSMONTH ( CalendarTable[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 | |
95 | |
77 | |
69 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |