calendar
21 TopicsPrevious Year Measure for Line Chart
Hello. I am trying to create a YOY cumulative active customer by month line chart. The line should show the number of customers who made at least one purchase. One for Selected Year and another for Selected Year - 1. And, the total is rolling, so the line should be going up over time. Because there is a year filter in play, I am having difficulties writing a measure that provides a PY Active Customer line for the line chart. If I have 2026 selected, previous years' active customers is reduced. So, I have to removefilter the Calendar. However, this causes the PY active customer line ignore the month on the X axis resulting in a flat total line. Please help me write a measure that accurately calculates PY active customers and still works in a line chart. Should look something like this: Sample file here. Thanks.Solved3.4KViews0likes10CommentsIssue with accounting for holidays in my workday count for 3 separate locations
I am having issues accounting for holidays in my workday count for each location. I currently have 2 fact tables that are joined to a calendar table and the calendar table connected to my holiday table. In my Holiday table i have a list of dates, holiday name and a location code. I have 3 location codes that are tied to 3 different locations. 1 code per location. Each location has a different set of holidays that they are closed. For example location code A has 10 different holidays tied to it. location code N has 11 holidays tied to it and code C has 9 holidays tied to it. I am trying to create a measure in a matrix that will basically show the count of working days for the week for each location including if there is a holiday. For Locaiton N and C they work Mon-FRI(5 days) and M works 7 days a week. If there is holiday i would like to drop my workday number down by 1. Currently my measure for workdays looks like this WorkingDaysPerWeek = VAR SelectedLocation = SELECTEDVALUE(LocationSlicer[Location]) RETURN CALCULATE( COUNTROWS('Calendar'), FILTER( 'Calendar', ( (SelectedLocation IN {"N", "C"} && 'Calendar'[Day Of Week] > 0 && 'Calendar'[Day Of Week] <= 5) || (SelectedLocation = "M") ) ) ) The code above is working perfect to show the workdays for each location. My 2 fact tables have the location code in them. I am having issues tying in the holidays. I have another table called LocationSlicer that is joined to my fact tables that basically acts as a slicer so i can pick my location.(there are multiple codes that tie into a location) Any help is appreicated!Solved709Views0likes3CommentsCalendar 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.5KViews1like10CommentsNo scrollbar at the x-axis
Hi Community, I've got the following X-axis (no scrollbar), but when I choose EOMONTH, the datapoints don't represent the actual graph. Is it possible to create a line-chart visual without a scrollbar, but with actual weeks, like 2020-18 - 2020-19 etc. etc. The format of the week is text and 2020-18 / 2020-19. When I try to make this number/date, for example 202018; between 202052 and 202101 there is a lot "white"space; In excel you can take the labels and there it is. Here, in PBI I find this very hard. Can someone help me? Thanks!1.5KViews0likes6CommentsHelp with calendar
Hi, I have a baffling issue creating column Month (see the screenshot) where the date column will change to the next month. Without adding column Month - table values are correct Add Month column - the date column is wrong Any hints are appreciated. Thanks.Solved867Views0likes4CommentsSum if date is within last 7 calendar days of month
Hi, I need to calculate the sum of the # of invoices, but only if the Date is in the last 7 calendar days of each month. I will have YTD data, updated daily. # invoices Date 7 6/27/2023 4 6/28/2023 2 6/29/2023 1 7/21/2023 2 7/22/2023 4 7/27/2023 5 7/28/2023 2 7/29/2023 3 7/31/2023 I thought about trying to create a column with "true" if it is in the last 7 days, and "false" if not. But I don't know how to write that. Anyone have ideas?Solved1.1KViews0likes4CommentsTime Intelligence Function - Do I need a calendar?
Hi, I am a bit confused if I would require a calendar for my data analysis. I viewed a post similar to my question but it did not give the answer I needed. My data is extracted from SAP to MS Excel as the example shown below. I am trying to perform an analysis of my current year actuals vs current year budget vs previous year actuals for each product group in respective to their country. This should be done as per the year to date figures. As you can see, my data does not have a calendar (day month/year) for each sales. Is this necessary? If so, what are my options? Posting Period Current Year Actual Current Year Budget Previous Year Actual 1 10,000 9,000 8,000 2 7,000 8,000 8,000 3 6,000 5,000 7,000 4 6,000 6,000 5,000 5 4,000 7,000 5,000 6 12,000 10,000 11,000 7 13,000 12,000 10,000 8 9,000 6,000 7,000 9 7,000 5,000 8,000 10 5,000 6,000 5,000 11 8,000 7,000 5,000 12 10,000 7,000 5,000 I'm currently trying to figure out how I can calculate the year to date values for each criteria (CY actuals vs CY budget vs PY actuals). With this, I want to summarise the data for each country/product group. I would really appreciate if you could help. Many thanks.1.2KViews0likes5CommentsCannot understand this measure I inherited
Hi, I inherited this measure from someone who was building reports for our company before I started. When used as a filter it seems to limit the data returned to revenue items for the current month or the previous month. Would anyone be kind enough to try to interpret it for me? MonthOnlyLedger = VAR monthNum = IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY())-1) VAR yearNum = YEAR(TODAY()-31) VAR zeroNum = INT(CONCATENATE(0, monthNum)) Return OR(CONTAINSSTRING(SPSRevenue[DisbursedToLedger], IF(monthNum > 9, CONCATENATE(RIGHT(yearNum,2), monthNum), CONCATENATE(RIGHT(yearNum,2), CONCATENATE("0", monthNum)))), CONTAINSSTRING(SPSRevenue[DisbursedToLedger], FORMAT(TODAY(), "yymm")))Solved678Views0likes2CommentsCalculating Total Employees each Month
Hi All, Looking to create a measure which tells me which employees are present at a certain month and year. I have a "Persons" Table with the following fields: Full Name, First Name, Last Name, Start Date, End Date. I have a "Calendar" table with the following fields: Date, Month, Year, YearMonth. Calendar is linked to Persons via an Active One to Many Relationship to Start Date. And a non-active relationship between date and End Date. How I can calculate how many staff at present at each month and year using this information. As the result I'm getting at the moment are only returning data for the month where people have a start date. For Example Aiden Sally's Count should appear from Jun 2018 - March 2023. For Example Yuliia Susan's Count should appear from Jun 2022 - March 2023.2.1KViews0likes8Commentscalculate how many holidays employee should taken since offboarding date
So created a visual table that pull the information of the employee's start and end date from two tables but now I want to know how I can show the number of federal holiday an employee should have taken from their start date this year 2022 to when they offboarded. Let's say that an employee onboarded on April 2021 and offboarded on 9/30/2022..I only want to know the number of holidays in Hrs ( assuming they work 8 hrs a day) they should have taken in the 2022. then then once 2022 is over how many holidays they taken in 2023..so on and so on.. I have the holiday table set up to take in all the holiday for the next 10 years so that it can just auto populate. I have a holiday calender with holiday till 2033 and then I have calendar table for only current year with the Holiday tag from this in which is tag which days are weekends and holiday observed day of the week. https://community.powerbi.com/t5/Desktop/Public-Holiday-Script/m-p/178341#M78058Solved1.7KViews0likes8Comments