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.
Would be able to do manual adjustments in the GL on a weekly basis.
My goal is to use a slicer to select a fiscal year and period (single-select) and a parameter to dictate the number of periods back. I'm using two calendar tables, one for the slicer and the second to render all dates.
My goal is to be able to select a year & period and be able to return the N number of months back (e.g. if I select 2022-02, [February], and 3 periods back, my periods would be 02, 01, and 12) but to also be able to look across multiple years for the same periods (e.g. 2022, 2021, 2020 for the periods 02, 01, 12) and be able to return a chart like:
I get close with:
Sales_Test =
var v_min = [n Months Ago]
var v_max = [SelectedMonth]
return
CALCULATE( sum(Sales[Net Value]),
REMOVEFILTERS(Calendar1),
Calendar1[PeriodVal] >= v_min, Calendar1[PeriodVal] <= v_max,
USERELATIONSHIP(Calendar1[DATE_SQL],Calendar2[DATE_SQL]))
where:
n Months Ago =
var selected_month = DATE(LEFT(SELECTEDVALUE(Calendar1[YearPeriod]),4),right(SELECTEDVALUE(Calendar1[YearPeriod]),2),15)
var nmonths = 'Months Back'[Months Back Value]
var _eom = EOMONTH(selected_month, -nmonths)
var date_build = date(year(_eom),month(_eom),15)
var fisc_per = CALCULATE(min(Calendar2[YearPeriod]),Calendar2[DATE_SQL] = date_build)
return
fisc_per
and
SelectedMonth =
SELECTEDVALUE(Calendar1[YearPeriod])
unfortunately timeintelligence functions do not work due to the custom fiscal calendar.
Hi @GD-L ,
Try the following option. http://sqljason.com/2018/03/display-last-n-months-selected-month-using-single-date-dimension-in-powe...
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |