date
147 TopicsHow to handle two date conditions on the same chart while keeping visual interaction in Pow
Hello, I have been trying for several days now to solve an issue in my Power BI report. Context: I am analyzing ticket creation, resolution date, and compliance for a client. How: I determine whether tickets fall within the scope of the analysis by applying several filters: ticket type resolution date a date range status Why: Once the tickets meet these criteria, my measure returns "OK" if they are compliant, or "KO" if they are not. Requirements: First, I need to check that tickets are in "Authorized" status and that their [duedate] is earlier than the date selected in the filter. Second, I need to check that tickets are in status ("Qualified" OR "Closed") and that [duedate] falls within a date range selected in the filter. Additional constraints: Both KO and OK tickets must be displayed on the same chart. There must be only one single [duedate] date filter on the report page. The chart must remain interactive with the table showing the ticket details within the analysis scope. In other words, when I click on the "KO" slice in the chart, only KO tickets should appear in the table. Same for OK tickets. Here is the formula with the date filters included, just to illustrate the logic: C1 = IF( AND( OR( NOT(AND( 'TABLE'[statusName] = "Authorized", 'TABLE'[duedate]<=DATE(2025,12,15) )), 'TABLE'[statusName] IN {"Technically qualified", "Operationally qualified", "Closed"} && NOT(ISBLANK('TABLE'[TQ_StatusDate])) && 'TABLE'[duedate] >= DATE(2025,09,01) && 'TABLE'[duedate] <= DATE(2025,12,15) ), 'TABLE'[TQ_StatusDate]<='TABLE'[duedate] ), "OK", "KO" ) Problem: If I filter on the interval from 2025-09-01 to 2025-12-15, the first part of my formula is no longer exhaustive, because for that part I need to include everything before 2025-12-15, not just what falls inside the selected interval. I managed to work around this by using the ALL() function (to remove the date constraint) in order to count tickets matching the criteria and display them in a single chart, but this only gives me aggregated counts and removes the interaction with the detail table. Thank you in advance for your help. CharlesSolved1.1KViews1like7CommentsRolling Date Identifiers
I support a team monitoring weekly captured data from a 5 week window. Each row of my set has a specific date - thousands of rows of data fitting into 5 weeks, and my report needs to dynamically compare each week's data with the others. I'm working to prep DAX to assign number 1-5 to each of the weeks as the project rolls on. So currently: Dec 22 = 1, Dec 29 = 2, Jan 5 =3, Jan 12 = 4, Jan 19 = 5. Next week: Dec 29 = 1, Jan 5 = 2, Jan 12 = 3, Jan 19 = 4, Jan 26 = 5 and so on.. First time in the forums so please let me know if I need to provide additional context.Solved1.2KViews2likes6CommentsToggle between columns used in a date slicer
Hello hopefully this is pretty straightforward. I am wondering if it is possible to have a date slicer on my page, but allow the user to toggle between two dates. For example, I have order date and due date. I want to have just one date slicer on the page, but allow the user to select "Order Date" or "Due Date" from another slicer. Based on their selection, I want the date slicer to use the appropriate date field. Is that possible? I have looked into a slicer table and then a measure, but in the measure I am not sure how to return the date values to use in a slicer, only to return calculated values such as counts and totals.Solved759Views0likes1CommentDynamic Holiday Calendar
Sharing this solution in case anyone else finds it useful. My company closes on US Federal Holidays and some additonal dates. The difficulty with identifying this data year after year is that some of these dates are dyanmic based on the week in a month or when they are observed if falling on a weekend. Obviously the static dates are easy year after year. After a lot of piecing together and trial/error, here's the measure I created w/notes on what the date represents: isholiday = SWITCH(([Date]), DATE(YEAR([Date]), 01, 01), "Y", // New Year's Day IF(WEEKDAY(DATE(YEAR([Date]), 01, 01), 2) = 7, DATE(YEAR([Date]), 01, 02),""), "Y", // New Year's Day on Sunday, observed 02Jan IF(MONTH([Date]) = 1, CEILING(EOMONTH([Date],-1)-1,7)+16, ""), "Y", //MLK Day (3rd Monday in Jan) IF(MONTH([Date]) = 2, CEILING(EOMONTH([Date],-1)-1,7)+16, ""), "Y", //President's Day (3rd Monday in Feb) IF(MONTH([Date]) = 5, CEILING(EOMONTH([Date], 0)-1,7)-5, ""), "Y",//Memorial Day DATE(YEAR([Date]), 06, 19), "Y", //Juneteenth IF(WEEKDAY(DATE(YEAR([Date]), 06, 19), 2) = 6, DATE(YEAR([Date]), 06, 18),""), "Y", // Juneteenth on Saturday, observed 18Jun IF(WEEKDAY(DATE(YEAR([Date]), 06, 19), 2) = 7, DATE(YEAR([Date]), 06, 20),""), "Y", // Juneteenth on Sunday, observed 20Jun DATE(YEAR([Date]), 07, 04), "Y", // July 4th IF(WEEKDAY(DATE(YEAR([Date]), 07, 04), 2) = 6, DATE(YEAR([Date]), 07, 03),""), "Y", // July 4th on Saturday, observed 03Jul IF(WEEKDAY(DATE(YEAR([Date]), 07, 04), 2) = 7, DATE(YEAR([Date]), 07, 05),""), "Y", // July 4th on Sunday, observed 05Jul IF(MONTH([Date]) = 9, CEILING(EOMONTH([Date],-1)-1,7)+2, ""), "Y", //Labor Day (1st Monday in Sep) IF(MONTH([Date]) = 11, CEILING(EOMONTH([Date],-1)-4,7)+26, ""), "Y", //Thanksgiving (4th Thursday in Nov) IF(MONTH([Date]) = 11, CEILING(EOMONTH(DATETABLE[Date],-1)-4,7)+27, ""), "Y", //Day after Thanksgiving (4th Friday in Nov) DATE(YEAR([Date]), 12, 24), "Y", //Chrismas Eve DATE(YEAR([Date]), 12, 25), "Y", //Christmas Day DATE(YEAR([Date]), 12, 26), "Y", //Closed DATE(YEAR([Date]), 12, 27), "Y", //Closed DATE(YEAR([Date]), 12, 28), "Y", //Closed DATE(YEAR([Date]), 12, 29), "Y", //Closed DATE(YEAR([Date]), 12, 30), "Y", //Closed DATE(YEAR([Date]), 12, 31), "Y", //New Year's Eve "") Pre-requiste: Date table with a Date field. To assess if your date in another table is a holiday in your Date table (1:M or 1:1 relationship with additional tables), you can use this formula in a measure: IF( CALCULATE( MIN('DATETABLE'[isholiday]), FILTER('DATETABLE', [Date] = MIN([yourdatetocompare]) && [isholiday] = "Y")) = "Y", dothisiftrue, dothisiffalse) Hope someone else finds this useful and if you do - cheers!Solved1.3KViews0likes1CommentCalculate Days in Two Months Based on Start and End Date
EVALUATE VAR StartDate = DATE(2024, 9, 17) VAR EndDate = DATE(2024, 10, 5) -- Find the last day of the start month (September) VAR EndOfStartMonth = EOMONTH(StartDate, 0) -- Calculate the number of days in the start month (September) VAR DaysInStartMonth = DATEDIFF(StartDate, EndOfStartMonth, DAY) + 1 -- Calculate the number of days in the end month (October) VAR StartOfEndMonth = DATE(YEAR(EndDate), MONTH(EndDate), 1) VAR DaysInEndMonth = DATEDIFF(StartOfEndMonth, EndDate, DAY) + 1 -- Return the result RETURN UNION ( ROW ( "Month", FORMAT(MONTH(StartDate), "mmmm", "en-US"), "Days", DaysInStartMonth ), ROW ( "Month", FORMAT(MONTH(EndDate), "mmmm", "en-US"), "Days", DaysInEndMonth ) ) without using format function i get correct month like 09,10 as month. but when i pass month(startDate) to format function returns only January as month. Any why it does that? Month Days January 14 January 5 I want to get Month Days September 14 October 5Solved905Views0likes3CommentsIssue with Multiple date keys and displaying dates on report.
Hello, i am working on a SSAS Tabular model to support Power BI report development. Our main fact table has multiple dates (Order Date, Paid Date, Shipped Date) with the Order Date being the active relationship to the date dimension. One of our reports requires a table that has the following columns (amoung others) Date and Amount by Paid Date. I understand how to build the measure "Amount by Paid Date" using USERELATIONSHIP to active the relationship between my fact.paid_date_key and the dim.date_key. Other than fully duplicating my date dimension to have a "Paid Date Dimension" and use that inactive relationship. how can i include "Paid Date" in my report table?1.3KViews0likes7CommentsHelp 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.Solved867Views0likes4CommentsFilter a Line Chart via DAX Measure to report ONLY for Max Date
Hi all, I have a requirement from our userbase that they'd like to be able to switch between measures reported in a line chart. The trouble I'm running into is that some of these measures can only be reported as of the max date - metrics such as Open Roles, % of Employees on a Succession Plan, etc. Using the 'Open Roles' measure as an example, when a user selects the option on the left for 'Open Roles', I'd like the Line Chart to ONLY report the value for the maximum selected date and exclude the other Month/Year values from the axis: I've tried MAX/MAXX/etc but am coming up short. Any ideas?595Views0likes3CommentsMIN value of a slicer based on a date in MM.YYYY format
Good afternoon, Please help with advice. There is a field in the DATE format, contains only the month and year (2.2021, 8.2023, etc.). The client want to use a slicer in the "between" style (they don't like the extra Timeline slicer). Power BI automatically displays dates in the format dd.mm.yyyy, which means that the table value of 8.2023 corresponds to the value of 1.8.2023. I use the MIN and MAX functions to determine the minimum and maximum value of the slicer. I need that if I select a date other than the first day of the month, the selected month will be returned to me, not the next one. For example, for 5.12.2021, I need to get the value 1.12.2021 instead of 1.1.2022. Is it possible? Thank you in advance.Solved1.2KViews0likes6CommentsFirst creation date per customer
Hi All, I have one simple table with two columns: - one column for the customergroup name -one column showing when that customer group was created A customer group can have multiple customers. That's the reason why we have multiple creation dates per customer group. I would like to create a dax that shows the first date of creation per customer group. Example: CustomerGroup1 has 3 dates but the first one was created the 1/01/2021 and therefore, I want to see that date shown up in a new column. Thanks very much for your help!974Views0likes4Comments