calendar table
8 TopicsHow to change fiscal year coding
I have taken over a file that already had a default calendar table. My company's fiscal year starts on 4/1 each year and am looking to make adjustments to the calendar table to reflect this. Right now coding is Fiscal Year",if(_startOfFiscalYear=1,YEAR([Date]),YEAR([Date])+ QUOTIENT(MONTH([Date])+ (13-_startOfFiscalYear),13)) How would I update this to start the FY in April and how can I change to have the data show as FY159 instead of 2024?Solved773Views0likes3CommentsCalendar Table returning error: The expression specified in the query is not a valid expression
I am racking my brain. I am building a PBi dash from a SharePoint list. Before, the list had only a few lines of test data, so I had no problem creating the calendar table. However, I have a second data source, and I needed to build a calendar based on both sources' tables to make a splicer to filter visuals by date. At first, I thought the issue was that I had 2 data sources, so I combined them into 1 data source and simplified my DAX Date = CALENDAR( MIN('Deskside QA'[DateofQA]), MAX('Deskside QA'[DateofQA]) ) But after that, I get the error "The start date in Calendar function can not be later than the end date." So I added variables to lock down the functions Date = VAR MinDate = CALCULATE(MIN('Deskside QA'[DateofQA])) VAR MaxDate = CALCULATE(MAX('Deskside QA'[DateofQA])) RETURN IF( ISBLANK(MinDate) || ISBLANK(MaxDate) || MinDate > MaxDate, CALENDAR(TODAY(), TODAY()), // Fallback to a single day calendar if dates are invalid CALENDAR(MinDate, MaxDate) ) But then I get the error "The expression specified in the query is not a valid expression" I have been running in circles and throwing in curly brackets but nothing seems to give me a solution.Solved3.5KViews1like10CommentsA circular dependency has been detected adding one column to a calendar table
Hello!! I have a large database of animals on a farm. I have the following measure to make the inventory that works for me however it takes a long, long time to finish. I had plans to put this formula in the PBIx calendar table adicinal column and thus have the values already calculated in a table in the hope of reducing time in inventory calculations and subsequent formulas with this data. I don't know if I'll succeed. However, when I place a column with the formula below in the calendar table with this measure, I get the error : A circular dependency has been detected: Calendar[Column]. Do you think it's possible to transform this DAX formula so that it doesn't have the circular dependency? I'd like to avoid making another inventory table, that works, although when related to the calendar table (1-1) it gives the same circular dependency error. And I´ll get a lot of difficulties in fixing all relationships.. I'm really at a blind spot with this step. Thank you Best regards INVENTÁRIO PORCAS = VAR MatrizesEntradas = CALCULATE( CALCULATE( COUNT(SOWS[Mating]), USERELATIONSHIP('Calendar'[Date], SOWS[Mating]), USERELATIONSHIP('FARM SETTINGS'[SiteId], SOWS[SiteId]) ), FILTER( ALL('Calendar'), 'Calendar'[Date] <= MAX('Calendar'[Date]) ), USERELATIONSHIP('Calendar'[Date], SOWS[Mating]) ) VAR MatrizesSaidas = CALCULATE( CALCULATE( DISTINCTCOUNTNOBLANK(CYCLES[ID&FARM]), NOT(ISBLANK(CYCLES[Dia Saida])), USERELATIONSHIP('Calendar'[Date], CYCLES[Dia Saida]) ), FILTER( ALL('Calendar'), 'Calendar'[Date] <= MAX('Calendar'[Date]) ) ) RETURN CALCULATE( MatrizesEntradas - MatrizesSaidas, FILTER( ALL('Calendar'), 'Calendar'[Date] <= MAX('Calendar'[Date]) ) )1.9KViews0likes6CommentsCreate Formula using Custom Calendar_Table
Hello - Appreciate any assistance on this! I have a custom Calendar_Table, where our FY starts in June. The Sale_Date column from the Sales_Table has a "relationship" established with the Calendar_Table Date column. In the Sales_Table I want to create a formula to calculate cost based on the FY FH column in my Calendar_Table however I am getting the following error with this code: The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column. Cost = IF('Calendar_Table'[FY FH] = "FY24 H1", calculate(((90593*1.3)+(7549*4))*0.5, BLANK())) CALENDAR_TABLE DAX Calendar_Table = VAR _startdate = EDATE(TODAY(),-60) // this goes back 60 months from today VAR _enddate = EDATE(TODAY(),24) // if you want future dated records use EDATE(TODAY(),12) it'll put you 12 months into the future // you can mix and match all the columns as you need RETURN ADDCOLUMNS( CALENDAR(_startdate,_enddate), "Calendar Year", YEAR([Date]), // Calendar Year //"Calendar Quarter", "Q" & QUARTER([Date]), // CY Qtr //"Calendar Month", MONTH([Date]), // CY Month nbr //"Calendar Week", WEEKNUM([Date],1), // CY Week nbr "Day", DAY([Date]), // CY Day nbr //"Day Name", FORMAT([Date],"dddd"), // CY Day name "Year Month Name", YEAR([Date]) & " " & FORMAT([Date], "mmmm"), // CY Year and Month Name "Year Month Number", year([Date])&FORMAT(month([Date]),"00"), // CY Year month nbr "Month Name", FORMAT([Date],"mmmm"), // CY Month Name "FY", if(MONTH([Date])>= 6, YEAR([Date])+1, YEAR([Date])), // Fiscal Year "FQ", "Q" & QUARTER(EDATE([Date],-5)), // FY Qtr //"FM", MONTH(EDATE([Date],-5)), //FY Month nbr //"Fiscal Week", WEEKNUM(EDATE([Date],-5)), // FY Week nbr "FY FQ", if(MONTH([Date])>= 6, YEAR([Date])+1, YEAR([Date])) &" "&"Q" & QUARTER(EDATE([Date],-5)), // eg 2019 Q4 "FY FQ2", "FY"&RIGHT(if(MONTH([Date])>= 6, YEAR([Date])+1, YEAR([Date])),2) &" "&"Q" & QUARTER(EDATE([Date],-5)), // eg FY19 Q4 "FY FH","FY"&RIGHT(if(MONTH([Date])>= 6, YEAR([Date])+1, YEAR([Date])),2) &" "&if(MONTH([Date])>= 6 && MONTH([Date])<= 11,"H1","H2"), "FH TEST",if(MONTH([Date])>= 6 && MONTH([Date])<= 11,"H1","H2") ) SALES_TABLE (tied to DATE in Calendar_Table in PBI relationships) sale_dt 3/31/2022 12:00:00 AM 7/31/2023 12:00:00 AM 3/4/2022 12:00:00 AM 5/2/2022 12:00:00 AMSolved488Views0likes1CommentCreating a week offset that resets every year
Hi Im in the middle of creating a calendar table for a new report and am seeking a way of reporting in variable periods for each year. Is it possible that for the 1st january the period starts and for the 31st December it ends. It would be useful for me for every x number of weeks = 1 period allowing me to change reporting periods as I please. Thanks1.2KViews1like2CommentsHelp with calculating specific delay time per day
Hi, I am trying to make a report that would give the delay time per day (which would give me the run time per day to get approximate TPH). An example delay data table is formatted as shown below. Since I have to calculate tons per hour for every day using another table with production information, I created a Calendar table (just a one-column table with only the dates using the CALENDAR() function) that is connected with both the delay table and production table. However, I am struggling to calculate the number of hours of delay time per day with DelayType 0 as a column in the calendar table with the format shown below using the previous delay table as an example. I tried making a calculated column using DATEDIFF() but I am struggling to get only the entries with DelayType of 0 as well as how to deal with delays that span for multiple days (For example, 05/26/2023 falls within the 4th entry of the delay table so the total delay time for that day would be 24 hours). I would appreciate any help or guidance on what I can do to get the final formatted Calendar table. Thank you.Solved1.3KViews0likes2CommentsCreate a Calendar Table based off values from another table
Hello, I am creating a sales report and want to create a calendar that starts with 1/1 and min year in the sales table and ends with 12/31 and max year in the sales table. CalendarTbl = Calendar(Date(Year(Min('F-Sales'[Xtn Date])), 1, 1), Date(Year(Max('F-Sales'[Xtn Date])), 12, 31)) I also need columns for Year, Qtr, Month - with Hierarchies created automatically. Appreciate your suggestions for a good way to do it. Is it better to do it via Power Query or DAX? Thanks, Pav2KViews0likes1Comment