"date"
9 TopicsUse week-slicer to filter visual on the according month
Hi all, We want to create a report and faced a problem, that we will need to solve also for future reports. In our current implementation, we use a slicer on one column of our date-table that filters the Calendarweek (Format YYYY.WW). The values of a table-visual are filtered using this selected value and that works fine. Now we have another visual, that we want to filter by the month that corresponds to the last day of our week. I.E. if we consider calendar week 48 in 2024 we get the 01.12.2024 as the last day of the week. So we want to filter our second visual to use all dates in december 2024. Currently we are having problems creating a dynamic filter criterion that filters our second visual based on the corresponding month of the selection of our week slicer. Does anyone have some suggestions how we can implement this in PowerBI? Thanks in advanceSolved900Views0likes3CommentsChart Granularity
I have a graph that shows the Offered, Answered & Abandoned calls from my data set. I have this on the y-axis of a bar chart and then I have created a parameter for the dates on the x-axis. This allows me to use a slicer to swap between the granularity levels (Daily, Weekly, Monthly).To achieve this, I have a date table that has all the dates for this year, along with a column defining the month and a column defining the week commencing date. I want the Daily view to show the last 30 days, the weekly view to show the last 8 weeks and the monthly view to show the last 12 months. This is where I am running into an issue. I can't get the dates to change with the granularity which causes my data to show an entire year of data on all the views. How can I change this so the date range of the displayed data aligns with the desired granularity that is being set by the slicer?Solved801Views0likes2CommentsHelper function for date comparison
I have many formulas which calculate a measure. For instace: sales, itemQty, returns, returnQty etc. etc. Basiscally, they all follow the same pattern. For instance: itemSales = SUM(ob_sales[paidAmount]) In this report, I have a conditional 'last year' setup. When people select only 1 of 3 days, i need to shift back 7*52 days. When a month is selected (ie: aug 1 till aug 31), then I want to use SAMEPERIODLASTYEAR. So, the measure below is working fine: itemSalesLY = VAR SelectedDatesCount = COUNTROWS(VALUES('calendar'[Date])) VAR IsSmallSelection = SelectedDatesCount <= 27 VAR DateRangeLastYear = CALCULATE( SUM(ob_sales[paidAmount]), DATEADD('calendar'[Date], -52*7, DAY) ) VAR SalesLastYearExactDates = CALCULATE( SUM(ob_sales[BetaaldExclBtw]), SAMEPERIODLASTYEAR('calendar'[Date]) ) RETURN IF( IsSmallSelection, DateRangeLastYear, SalesLastYearExactDates ) This works like a charm, but as I said, I have many measures which need to use this LY date logic. So, I thought I'll create a lastYearDateHelper expression, but this is where it gets ugly. Whatever i try, it always ends in errors like A function ‘PLACEHOLDER’ has been used in a True/False expression that is used as a table filter expression. This is not allowed. The goal is to have something like this: itemSalesLY = CALCULATE( SUM(ob_sales[paidAmount]), [LastYearDateHelper] ) Is this even possible?Solved1.8KViews0likes6CommentsTrying to Predict Monthly/Quarterly/Yearly Payments using DAX
Hello all! My colleague and I are trying to find a way to calculate the expected payments accross all of our subscriptions throughout a given timeframe using the following variables - The Start Date for the subscription - The End Date of the subscription - The Billing Cycle (Monthly, Quarterly, or Yearly) - The Amount to be billed on each cycle For now, I will focus only on monthly billing, as the other I imagine will use the same logic for the most part. If I have 3 contracts, - one beginning on 1/1/2024 with $100 monthly payments - one beginning on 2/1/2024 with $150 Monthly Payments - one beginning on 3/1/2024 with $200 Monthly Payments I would expect a visual showing a MRR of $100 for January, $250 for February, and $450 for March. However, the functions I have been experimenting with all seem to only show the payment on the starting month of each contract (Jan $100, Feb $150, mar $200) The end result we are looking for is to have a stacked bar chart visual that shows the total expected (upcoming) payments for active contracts for each billing cycle type. Are there any resources someone can point me to for solving this? Thanks in advance for any and all advice!Solved789Views0likes1CommentMeasure w.r.t to dynamic end date
Hi all - I created a measure that serves two purposes: by default, it displays the latest sales, and when the user applies a date filter, it shows the average sales. However, currently, when new dates are added, users need to manually select the date to ensure the average sales are correctly reflected. Could you suggest alternative solutions? I'm looking to address this without creating multiple measures, aiming to solve it with a single measure. Model: Data and Measures: Measure: Total Sales Amt = VAR LatestDate = MAX ( 'Is Latest'[Latest Sales Date] ) VAR LatestData = CALCULATE(SUM('FactSales'[SalesAmt]), 'DimDate'[Date] = LatestDate) RETURN IF (ISCROSSFILTERED('DimDate'[Date]),SUM('FactSales'[SalesAmt]), LatestData) Average Sales Amt = VAR TotalSales = 'FactSales'[Total Sales Amt] VAR NoOfDays = IF (ISCROSSFILTERED('DimDate'[Date]), SUM('DimDate'[No Of Days Sales]), 1) RETURN DIVIDE(TotalSales,NoOfDays,0) I'm using the Average Sales Amount measure for both the Latest Sales visual and the Average Sales Amount visual. For the Latest Sales Amount, I've implemented an IsLatest flag. Working Scenario: When the user selects a date in the slicer, everything works as expected. Not Working Scenario: When a new date is added (e.g., 8/17/2024), it automatically appears in the date slicer, but the Average Sales Amount doesn't update because of the cross-filter logic in the measure. Users have to manually select the new date to display the correct value. Is there a way to automatically update the Average Sales Amount without requiring the user to select the date in the slicer? Latest Sales: Enabled Edit Ineractions: ( For Latest Sales, Slicer will not interact) Average Sales : Same Measure No Filter Selecting Date Slicer: Average Sales Amount updates Correctly Thanks, Abhiram631Views0likes3Commentslast date not shown correctly
Hello Dear Team, Got an issue with displaying the last date I have a table with startTime endTime and WeekRange startTime endTime 2024-07-02 2024-07-09 2024-07-09 2024-07-16 2024-07-16 2024-07-23 2024-07-23 2024-07-30 2024-07-30 2024-08-06 2024-08-06 2024-08-13 and I have added new column named WeekRange to show a Week Range in this format: 06-08-2024 to 13-08-2024 02-07-2024 to 09-07-2024 30-07-2024 to 06-08-2024 WeekRange = FORMAT([startTime].[Date], "DD-MM-YYYY") & " to " & FORMAT([endTime].[Date], "DD-MM-YYYY") Now I want to show in a Card visual only the last week range, On visualizations, when selecting in the Fields Last WeekRange it shows the 30-07-2024 to 06-08-2024 but not the correct one 06-08-2024 to 13-08-2024 Do you know how do I fix this ?Solved688Views0likes3CommentsAverage values of a column within the week before with conditions in the month before
I have a table 'TableSales' with 3 columns 'Date' (in date format), 'Cashier', 'Sale Amount', and another table 'TableDate' with 2 columns 'SelectedDate' (in date format) and 'SelectedDate_text' (date but in text format so that I can have the last date as "The latest day" instead of the date). I use 'TableDate'[SelectedDate_Text] to create a slicer so that users can choose a desired date. I would like to create a measure to calculate the average Sale Amount of Cashiers per day during the latest 7 days until the selected date in the slicer. I can do that with the following query: average = CALCULATE( SUM('TableSales'[Sale Amount])/COUNT('TableSales'[Cashiers]) ,FILTER('TableSales', 'TableSales'[Date <= MAX('TableDate'[SelectedDate]) && 'TableSales'[Date >= MAX('TableDate'[SelectedDate])-6)) However, now I want to filter out all Cashiers with Sale Amount = 0 or blank during the latest 1 month until the selected date because those cashiers are assumed to be broken and shouldn't be taken into the calculation of average. How should I include that into my measure? Thank you.678Views0likes3CommentsSlicer Date Range between two columns (filter help)
Hi, This is my Slicer I need to figure out in this date range exist anywhere between these rows for each group#? So I wanna say if _Min_Date_Slicer is between Min(Inc_Start) and Max(Inc_Start) __Max_Date_Slicer is between Min(Inc_End) and Max(Inc_End) FILTER( 'Table', GROUP#=_GRP && _MIN_Date_Slicer >= MIN([INC_START]) && _MIN_Date_Slicer <= MAX([INC_START]) && _MAX_Date_Slicer >= MIN([INC_END]) && _MAX_Date_Slicer <= MAX([INC_END]) ) Can you help with this function? Thanks!Solved604Views0likes1CommentDynamic Flag Column That Changes Rows Depending On Today's Date
Hi PowerBi Experts, I am facing an issue where I need to display a table of data depending on which day of the week it is. My dataset sample is as below - Project Name | Transaction Month | Reporting Date | Transaction Week Start | Transaction Week End | Weekly Sales Row 1 Project A | August 2023 | 7 August 2023 | 31 July 2023 | 6 August 2023 | 20 Row 2 Project B | August 2023 | 7 August 2023 | 31 July 2023 | 6 August 2023 | 3 Row 3 Project C | August 2023 | 7 August 2023 | 31 July 2023 | 6 August 2023 | 12 Row 4 Project A | August 2023 | 14 August 2023| 7 August 2023 | 13 August 2023 | 14 Row 5 Project B | August 2023 | 14 August 2023| 7 August 2023 | 13 August 2023 | 5 Row 6 Project C | August 2023 | 14 August 2023| 7 August 2023 | 13 August 2023 | 7 Row 7 Project A | August 2023 | 21 August 2023| 14 August 2023 | 20 August 2023 | 9 Row 8 Project B | August 2023 | 21 August 2023| 14 August 2023 | 20 August 2023 | 0 Row 9 Project C | August 2023 | 21 August 2023| 14 August 2023 | 20 August 2023 | 3 Now, the requirement is that if the user views the report on 14th August 2023 (Monday), the table should only show Rows 1 to 3, to show data within the Transaction Week range. This applies to all subsequent Mondays. From 15th August 2023 (Tuesday) to 20th August (Sunday), the user should only be able to view Rows 4 to 6. This is how the flag should work. What I've tried - I came up with this DAX formula, but it does not work as intended. It should only apply the flag to Rows 4-6, based on today's date (10 Aug), but it applies the flag to Rows 1-3 as well. VAR TodayDate = TODAY() VAR MondayTwoWeeksAgo = TodayDate - WEEKDAY(TodayDate, 2) - 13 VAR MondayOneWeekAgo = TodayDate - WEEKDAY(TodayDate, 2) - 6 RETURN IF( [Transaction Week Start] >= MondayTwoWeeksAgo && [Transaction Week Start] <= MondayOneWeekAgo, "Flag", BLANK() ) I am at a lost, and have been cracking my head for hours now, how can I achieve the aboe - any help will be greatly appreciated! Thanks & Best Regards, LeeWJ678Views0likes2Comments