Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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.
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
104 | |
93 | |
83 | |
64 |