dates
74 TopicsGetting the last date without time
Hi, I'm creating a measure which shows the last date. I'm creating it with the following measure: 6_last_issue_date = maxx(table1, table1[issue_date].[Date]) It isn't clear in the picture but I'm using a card to show the date on. I get the next result: And I'm trying to get the next result: I don't know where he gets the time from, because in my modeling tab of the data i put it on a format without time : dd/MM/yyyySolved15KViews0likes1CommentDynamic date calculation i.e. rolling total for 12-24 months ago
Hi all you helpful people! So I am trying to recreate an excel for someone (trying to convert everyone to PBI!!) which shows the following columns: Product name (easy) last 12 months rolling (managed that) *12 months BEFORE the last 12 months rolling (this is where i come unstuck!) Last 3 months rolling (ok with that) *Same 3 month period the year before (eeek help!) Last month total (fine and dandy) *Same month total last year (arghghghghghhg!) Please could you help me wiht those in with a *? I am a relative noob to this so am still fumbling my way around DAX. I was hoping SAMEPERIODLASTYEAR might help, but i couldnt get that to work on a table that wasn't date based. My tables are called: 'Sales' with the relevant field being [Value] 'Date table' [Date] or 'Sales' [relative continuous month] Hoping one of you can help me ๐Solved11KViews0likes20CommentsSWITCH TRUE FUNCTION FOR DATE BETWEEN DATES TO PERIOD 1
I'm trying to add a column via DAX to find a single date between date ranges e.g. April 1st - April 30th 2020 and make this value Period 1 and so on... Here's what I have so far: Column = SWITCH(TRUE(),'looker_views lkr_Audit'[Audit_DateTime], DATE >= DATE(2020,04,01) & DATE <= DATE(2020,04,30), "Period 1") However it keeps giving me the error: Failed to resolve name 'DATE'. It is not a valid table, variable or function name. So I changed this to a table i.e. Column = SWITCH(TRUE(),'looker_views lkr_Audit'[Audit_DateTime], 'looker_views lkr_Audit'[Audit_DateTime] >= 'looker_views lkr_Audit'[Audit_DateTime](2020,03,02) & 'looker_views lkr_Audit'[Audit_DateTime] <= 'looker_views lkr_Audit'[Audit_DateTime](2020,03,30), "Period 1") and the error comes up as: The function used in this expression is not a valid function nor the name of a measure. Thanks for any help offeredSolved6.6KViews0likes1CommentDAX Calculate Countrows, average per Year per Weekday
Hello, I think I have a simple question but I can't figure out how to do it. I have a table in BI for example with a Date column and a column with the matching weekdays. There can be multiple equal dates because it's an order picking table. I would like to have that it counts the rows from the same Weekday and divide it by the matching dates. So when I have 6 rows in total on Mondays and these Mondays matches two dates, the calculation should be 6 / 2 Then my average = 3 (check table as example) What should be the correct DAX formula for this? Date Day of the week 2022-01-03 Monday 2022-01-03 Monday 2022-01-03 Monday 2022-01-03 Monday 2022-01-04 Tuesday 2022-01-04 Tuesday 2022-01-05 Wednesday 2022-01-05 Wednesday 2022-02-07 Monday 2022-02-07 Monday 2022-02-08 Tuesday 2022-02-09 Wednesday 2022-02-10 Thursday 2022-02-10 Thursday etc. etc. Average Countrows per Year per Weekday Result Calculation Monday 3 6 rows on Monday / 2 Dates Tuesday 1,5 3 rows on Tuesday / 2 Dates Wednesday 1,5 3 Rows on Wednesday / 2 Dates Thursday 2 2 Rows on Thursday / 1 Date With kind regards, Bjรถrn KoenenSolved4.4KViews0likes9CommentsGrouping dates into fortnights
Hi everyone, I'm looking for a solution that will help in grouping dates into fortnights, irregardless of month or year. I'll attach an image to help understand what I am meaning. It wouldn't matter if the column started at calendar start or a specific date. The date table I have is just an invoked funtion in M. Hopefully someone can help, I'm not sure what other information I could provide that would be helpful here.Solved4.2KViews0likes2CommentsDAX expression to filter column for dates only in last month?
Hey everyone, I am trying to generate a measure that filters a column with dates for those which are only from the last month or last 30 days. I would like to use this in a calcuate function to see if the amount of rows which have the date in the last month and which meet antoher critera are greater than 0. Thanks!Solved2.9KViews0likes7CommentsAdding Number of Months to a Date
Hi, I am trying to add two different numbers to a date within my table using DAX. The date is when the product needs to be purchased 'First Order', i then want to add the Lead Time to this date 'LT' and then an additional 2 months to allow enough time for it to be shown in my account. The table looks like this: First Order LT (Months) 06/03/2023 10 09/03/2023 3 14/03/2023 5 Expected result would be - 06/03/2023 + 10 (LT) + 2 (Additional Months) = 06/03/2024 Any help will be greatly appreciated!! Thanks.Solved2.8KViews0likes7CommentsIF value exists on calendar date
Hi everyone, i need help creating a measure that evaluates whether a value in on table exists at a particular date within the calender table . I am working with Two tables, on main table that has a customer and a purchase date. The second table is just a table showing the daily calendar dates. the outcome wanted is to evaluate whether a purchase was made by a customer at a certain date on the daily calender. the tables are as shown below : RESULT If a customer has purchased something on the date equivalent to the calendar date, return true, else false. as shown below: If anyone could assist me with writing a measure that could produce this outcome that would be wonderful ๐ all help and sugegestions are welcome: Thank youSolved2.4KViews0likes6CommentsDynamic target visual based on dates
Hello everyone, I am trying to to make a dynamic target visual based on dates. We have set some client targets per month, so every month we should have a certain amount of total clients. So the visual should jump to the next target after every month. I have a measure for active clients: Total active Clients = var __svym = TODAY() return CALCULATE(COUNT('Clients'[Client Code]), FILTER('Clients', __svym>='Clients'[Start Agreement] && __svym <= 'Clients'[End Agreement]) And I have a table with the targets and dates: Month & Year Target Clients 31 January 2020 1170 29 February 2020 1195 31 March 2020 1220 30 April 2020 1245 31 May 2020 1270 30 June 2020 1295 31 July 2020 1320 31 August 2020 1345 30 September 2020 1370 31 October 2020 1395 30 November 2020 1420 31 December 2020 1450 I have set the column Month & Year as data type 'Date' and I also have a date table. What measure or what syntaxis should I try to make this dynamic target visual possible? Please let me know your ideas, Kind regards Rick2.2KViews0likes3CommentsReturn dates when condition is met
Hello Community! A few days I go I finished an Udemy course "Microsoft Power BI - Up & Running With Power BI Desktop" Now it's time to use that knowledge it in real life and life is brutal! I have a quite complicated task. I try to calculate kind of user efficiency rate like [quantity/hour] for example I baked 300 doughnuts in 20hours, it gives 15d/h or 1.1kg/h. 1.First I try to take dates from Table1 with code 111. 2.Then using those dates take GUIDs with action1. 3.Having GUIDs I can reach the properties like weight. In the end, the ratio SUM(weight)/SUM(hours) should be available for each user. Table1 Multiple users, codes and dates. USER CODE HOURS DATE User1 111 5 19.05 User2 001 4 19.05 User3 111 5 16.05 .... Table2 Multiple users, actions. . . USER ACTION Object_ID DATE User1 create guid1 19.05 User2 create guid1 19.05 User3 update guid2 16.05 .... Table3 unique GUIDs Object_ID weight property1 prop2.... guid1 w1 . . . . . . guid2 w2 . . . . . . guid3 w3 . . . . . . .... My post is dedicated to the first step. How to get dates from Table1 and use them as a filter to Table2? In which direction should I go, base only on measures, or new calculated tables? Or it's a too complicated task for PowerBI and I should shape the data with Python first? Kind Regards2.2KViews0likes5Comments