The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Estimates I have a dynamic Calendar table, which depends on a variable date that comes from another table, I need your support please to create an automatic YTD table, whose characteristics vary according to what varies the calendar table being the ytd the corresponding period from January to the last date of the calendar and the ytd-1, it is the same period but from the previous year, as shown in the image.
Thank you in advance for your support
I attach the link to the dynamic calendar table in pbix.
https://drive.google.com/drive/folders/1yOYWoBlYPly_HYCK6eJr5O0d5J8C52fw?usp=sharing
Solved! Go to Solution.
Hi, @Syndicate_Admin , @jminanoc
see my solution below:
NewTable =
var YTD_Dates = DATESYTD(Calendario[C_Fecha])
var YTD_Min = MINX(YTD_Dates, Calendario[C_Fecha])
var YTD_Max = MAXX(YTD_Dates, Calendario[C_Fecha])
var PreviousYTD = SAMEPERIODLASTYEAR(YTD_Dates)
var PreviousYTDMax = MAXX(PreviousYTD,Calendario[C_Fecha])
var PreviousYTDMin = MINX(PreviousYTD,Calendario[C_Fecha])
return CALCULATETABLE(Calendario, Calendario[C_Fecha] >= YTD_Min && Calendario[C_Fecha] <= YTD_Max|| Calendario[C_Fecha] >= PreviousYTDMin && Calendario[C_Fecha] <= PreviousYTDMax)
Hi, @Syndicate_Admin , @jminanoc
see my solution below:
NewTable =
var YTD_Dates = DATESYTD(Calendario[C_Fecha])
var YTD_Min = MINX(YTD_Dates, Calendario[C_Fecha])
var YTD_Max = MAXX(YTD_Dates, Calendario[C_Fecha])
var PreviousYTD = SAMEPERIODLASTYEAR(YTD_Dates)
var PreviousYTDMax = MAXX(PreviousYTD,Calendario[C_Fecha])
var PreviousYTDMin = MINX(PreviousYTD,Calendario[C_Fecha])
return CALCULATETABLE(Calendario, Calendario[C_Fecha] >= YTD_Min && Calendario[C_Fecha] <= YTD_Max|| Calendario[C_Fecha] >= PreviousYTDMin && Calendario[C_Fecha] <= PreviousYTDMax)
Thank you very much for your prompt response and accurate response, it is very similar to what I needed.
Hi, @Syndicate_Admin , @jminanoc
Glad to hear that, if you could Kudo and mark my original post as the solution.
Thank you
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
81 | |
57 | |
48 | |
48 |