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.
Dear Team I have below table with answer which I want to derive in my meansure. I want last 12 months sales total and monthly average based on my date table which is displayed in my slicer
Month - Dec
Year - 2019
jan | feb | mar | apr | may | jun | jul | aug | sep | oct | nov | dec | result | |
Total | 20 | 10 | 15 | 25 | 30 | 60 | 50 | 35 | 95 | 70 | 40 | 30 | 480 |
Average | 20 | 10 | 15 | 25 | 30 | 60 | 50 | 35 | 95 | 70 | 40 | 30 | 40 |
@GGDAC ,
Please follow the below steps,
first, create a calculated table with your Month Name (like, Jan, Feb etc) and month Number. (Make sure, this calculated table should not have any relationship with your date table)
Put the calculated table's month name into a matrix visual.
I think you have already put Year and Monthname from your date table into slicer and selected your desire month and year.
Now, create below measures,
Try like
Sales Value Last 12M =
VAR _End = EOMONTH(Sales[Date],0)
VAR _Star = DATE(YEAR(_EndDate),MONTH(_EndDate) - 12,1)
RETURN
CALCULATE(SUM(Sales[Value]), DATESBETWEEN(Sales [Date], _Start, __End))
Average Value Last 12M =
VAR _End = EOMONTH(Sales[Date],0)
VAR _Star = DATE(YEAR(_EndDate),MONTH(_EndDate) - 12,1)
RETURN
CALCULATE(Average(Sales[Value]), DATESBETWEEN(Sales [Date], _Start, __End))
in matrix you can use show on row to show you measure on the row. And put month on column.
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 |