March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I create a Calendar using a below code:
dcalendar3 =
ADDCOLUMNS(
CALENDARAUTO();
"Ano";FORMAT([Date];"YYYY");
"Mês";FORMAT([Date];"MMMM");
"Mês Curto";FORMAT([Date];"MMM");
"Núm Mês";MONTH([Date]);
"Trimestre";FORMAT([Date];"q");
"Mês/Ano";FORMAT(([Date]);"mmm") & "/" & YEAR([Date]);
"Ano Mês"; CONCATENATE(YEAR([Date]);FORMAT(MONTH([Date]);"00"));
"Dia da Semana";FORMAT([Date];"ddd");
"Núm Dia Semana";WEEKDAY([Date]);
"Dia Útil"; SWITCH(WEEKDAY([Date]);7;0;1;0;1);
"Feriado";LOOKUPVALUE(Feriados[Feriado];Feriados[Data];[Date];"")
)
I need to add a column to check if it's a business day or a holiday. And I'm using the following code for this:
Dias úteis sem Feriados = if(AND(dcalendar3[Dia Útil]=1;dcalendar3[Feriado]="");"Dia útil";"Dia não útil")
Sometimes when I add a new column, it causes an error in all the data in the column. It has already happened, for example, when I refer to one of the columns in the calendar, as is the case now. This time I had no mistakes, but they often haunt me.
Thanks!
Solved! Go to Solution.
I was making a basic mistake !!! You simply should have added the last column formula calculated within the one that created the calendar. So it stopped causing the error that happened when creating the new column.
I thank you in advance for the effort and attention of those who read this request!
HI @fabiojoa
Whta is error in your case? from the screenshot, it works well. and if is something wrong in your formula.
Could you please share your sample pbix file for us have a test.
Regards,
Lin
Hi!
Finally the error occurred, this morning when I opened the file ...
The column with my formula to find out if it is a working day or a weekend / holiday disappears and this one appears in error.
Thanks!
I was making a basic mistake !!! You simply should have added the last column formula calculated within the one that created the calendar. So it stopped causing the error that happened when creating the new column.
I thank you in advance for the effort and attention of those who read this request!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |