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, I want to know how i can see just the information of january's last year, acoording the month_year filter.
i.e: if i filter apr 2019, i want to see data sum(sales) of january 2018.
i.e: if i filter may 2018, i want to see data sum(sales) of january 2017.
Solved! Go to Solution.
Hello @kevderbeste
Give this a try.
Jan PY Sales = VAR ActiveDate = MAX ( Dates[Date] ) VAR PYNum = YEAR ( ActiveDate ) -1 VAR JanPYDates = FILTER ( ALL ( Dates ) , Dates[Year] = PYNum && Dates[Month Number] = 1) RETURN CALCULATE( [Sales Amount], JanPYDates )
Hi,
Assuming you have a Calendar Table with a relationship from the Date column of the Data Table to the Date column of the Calendar Table, create slicer for the Year from the Calendar Table and select any one Year. Write this measure
=CALCULATE(SUM(Data[Sales]),DATESBETWEEN(Calendar[Date],DATE(MIN(Calendar[Year])-1,1,1),DATE(MIN(Calendar[Year])-1,1,31)))
Hope this helps.
Hello @kevderbeste
Give this a try.
Jan PY Sales = VAR ActiveDate = MAX ( Dates[Date] ) VAR PYNum = YEAR ( ActiveDate ) -1 VAR JanPYDates = FILTER ( ALL ( Dates ) , Dates[Year] = PYNum && Dates[Month Number] = 1) RETURN CALCULATE( [Sales Amount], JanPYDates )
@jdbuchanan71 wrote:Hello @kevderbeste
Give this a try.
Jan PY Sales = VAR ActiveDate = MAX ( Dates[Date] ) VAR PYNum = YEAR ( ActiveDate ) -1 VAR JanPYDates = FILTER ( ALL ( Dates ) , Dates[Year] = PYNum && Dates[Month Number] = 1) RETURN CALCULATE( [Sales Amount], JanPYDates )
Thanks a lot, is the solution.
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 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |