dax date condition
11 TopicsDifference between the Months different count when Interest rate changes from Previous to Current.
Hi All, I am trying to calculate the month's different count when the Interest rate changes from Previous interest to Current interest changes. Please help Here Interest rate = INIT_DPOS_INT_PCT Below is the screenshot for reference Calculations need to be worked on the DAX column dynamically. Below is an example of Previous interest to Current interest month's difference count.589Views0likes2CommentsSame day Previous week DAX
Hi All, I have a table containing daily incident request raised by team members with columns - start date of INC, end date of INC, INC number, status, comments. Here, i need to build a report table showing date wise incident count and previous week count for each date. Eg: if today is 17/04/2023, then it should display count of incidents on that date along with previous week count. i.e. count of 10/04/2023 in same row. I have tried multiple dax formulas but nothing working. Either it returns day count or blank values. Please find attached image for reference.349Views0likes0Commentshow to get the previous nonblank value
i have posted this question twice before but the provided answer did not solve the case. im trying to find the previous day closing price for stocks so that i can calulate day on day change. the problem is stock market is not open everyday and in the days when the market is closed previous day price will be blank. im using the following measure but it's not returning the intended output when i present it in card visual or in scroller custom visual previous day price1 = CALCULATE(SUM('stocks data'[Close]), OFFSET(-1,ALLSELECTED('stocks data'[Date]),ORDERBY('stocks data'[Date],ASC))) as in the image, the measure works in table visual format but doesnt give last date nonblank value in the card visual. the expected output in the card visual should be 142.16 instead of 131062.04 appreciate the support as this is an urgent matter.Solved847Views0likes2Commentshow to get the value for the previous non blank date
im trying to find previuos day price for stocks so that i can calculate Day on Day change. the problem is stock market is not open everyday and in this case some days will be blank when i calculate previous day price . im using the following measure to get previous day stock price: previous day price = CALCULATE(SUM('stocks data'[Close]), PREVIOUSDAY('stocks data'[Date])) this is a screenshot of the measure results: expected result: any idea on how to fix the measure to calculate previous stock price based on the last non blank date1.6KViews0likes4Commentsdax calculation total is incorrect
im trying to calculate return on investement for stocks data based on the formula ( current price-initial cost)/initial cost. i calculated first the initial cost ( purchased amount * number of stocks purchased) then the current position price as: (current price* number of stocks purchased) and finally i want to get Profit/Loss amount and Profit/Loss %. simply i subtracted : current price-initial cost and for the percentage i calculated it as:( current price-initial cost)/initial cost. the result is correct for indivisual stock but the overall total purchased amount value, Profit/Loss value and percentage is incorrect in the total , it's taking the sum(last closing price) * sum (number of stocks purchased): 53*135934=7204502 which is wrong. the correct result should be the sum of column 4693.579996 which is the sum of all values in the amount purchased column. the line chart is also showing incorect percentages in the overall return but only correct values for indiviual stocks the used DAX measures amount purchased value = CALCULATE(SUM('user portfolio'[number of stocks purchased])*[last closing price]) p&l = CALCULATE([amount purchased value]-SUM('user portfolio'[Amount Purchased])) p&l % = CALCULATE(([amount purchased value]-SUM('user portfolio'[Amount Purchased]))/SUM('user portfolio'[Amount Purchased]),FILTER('stocks data','stocks data'[date diff]>=0)) puchasing date diff column = DATEDIFF(RELATED('user portfolio'[Date Purchased]),'stocks data'[Date],DAY) any idea on how to fix the calculation to show the correct overall profit/loss value and percetage? note: when calcuting ROI there are other things taken into consideration like : dividend, commission fees, etc. and this example is just a simple case 🙂Solved1.3KViews0likes4CommentsCount opened cases by day with "for" loop
Hello, I have following issue and I don't know how to start writting Dax measure (if it is possible in DAX). Lets say we have following data table: ID opened_at closed_at 1 opened_date closed_date 2 opened_date opened_date I would like to achieve a chart with dates on X axis - let's say last 30 days that will show count of ID's that opened_date <= day(i) and closed date > day(i) - meaning I would like to have a chart that shows number of events that were not closed on specific day. I cannot create aggregates in DataBase because it is not mine and I have only RO access. Any ideas how to start?Solved721Views0likes2CommentsRolling DateTime Calulation
Hello All, I am Receiving a daily rolling 10 Days Extract every day, where I need to modify the provided Date Column. Therefore I created an example Dataset with only the Date Column(File -->https://we.tl/t-8qG67CEYcQ) for testing purposes. Below you find the criteria’s I would need… Dates within the Extract… Todays Extract would be - From MinDateTime(02 Mar 2022 00:45) to MaxDateTime(11 Mar 2022 08:20) Tomorrows Extract would be - From MinDate(03 Mar 2022 XX:XX) to MaxDate(12 Mar 2022 XX:XX) Required date changes in an Extra Calculated Column should be… Dates > MaxDate 11 Mar 07:00 == Blank or NA 11/02 07:00 – 10/02 06:59:59 == 11/02 10/02 07:00 – 09/02 06:59:59 == 10/02 09/02 07:00 – 08/02 06:59:59 == 09/02 08/02 07:00 – 07/02 06:59:59 == 08/02 07/02 07:00 – 06/02 06:59:59 == 07/02 06/02 07:00 – 05/02 06:59:59 == 06/02 05/02 07:00 – 04/02 06:59:59 == 05/02 04/02 07:00 – 03/02 06:59:59 == 04/02 03/02 07:00 – 02/02 06:59:59 == 03/02 Dates < MinDate 02 Mar 07:00 == Blank or NA Thanks in advance for your Support Have a nice Day Best Regards Jan829Views0likes2CommentsDAX Patterns - Product results by year after launch date.
Hello Community, I am trying to figure out a way to create a measure(s) to calculate product results by year...following its initial launch date. The reason I have put "DAX Patterns" in the title is because this issue reminds me of something seen in the great DAX Patterns book/website however, I don't see this pattern mentioned in any of the literature. I am currently using the Month-related calculation patterns mentioned here in my model. Here is a simple example of the situation: Product 12345678910 launched in March 2018. I want to see sales volume by year, for years 1, 2, and 3. The pattern here would be: Year 1 = March 2018 to February 2019. Year 2 = March 2019 to February 2020. Year 3 = March 2020 to February 2021. I have sales volume results that go beyond year 3 but I do not need to see them - just the first 3 years of sales volume by year. I have thousands of products that have launched anywhere between 10/1/2017 to the current date and their results, so this would need to be dynamic based on launch date. Is there a pattern I can use to achieve the results I want to see? Thank you!Solved1.5KViews0likes2CommentsHelp required-Value from another table on the bases effective date
Hi, I have 2 tables, they are both join with product( many to many relationship). Order Order No Orderdate Product 1 01/01/2021 A 2 02/01/2021 B 3 01/02/2021 A 4 02/02/2021 B 5 02/02/2021 A 6 03/02/2021 B 7 25/02/2021 A 8 26/02/2021 A 9 07/02/2021 B 10 08/03/2021 A Cost Cost % EffectiveDate Product 1.1 01/01/2021 A 1.4 01/01/2021 B 1.5 01/02/2021 A 1.8 15/02/2021 A 1.9 01/03/2021 A 2 02/02/2021 B Need the result like this Order Order No Orderdate Product Cost% 1 01/01/2021 A 1.1 2 02/01/2021 B 1.4 3 01/02/2021 A 1.1 4 02/02/2021 B 2 5 02/02/2021 A 1.5 6 03/02/2021 B 2 7 25/02/2021 A 1.8 8 26/02/2021 A 1.8 9 07/02/2021 B 1.5 10 08/03/2021 A 1.9 If write custom colum to get cost% in order table this its give error of multiple values VCost% =LOOKUPVALUE('Product'[Cost%],'Product'[Product],'Order'[Product]) Or no result Vcost% =CALCULATE(SELECTEDVALUE(Product[Cost%]),Orderdate>=MINX(Product,Product[EfffectiveDate])&& OrderDate <=MAXX(Product,Product[EffectiveDate])) OR I have tried this also but no result Cost1% = Var MinEffDate = CALCULATE(MINX('Cost','Cost'[EffectiveDate]),FILTER('Cost','Cost'[Product]=('Order'[Product]))) Var MaxEffDate = CALCULATE(MAXX('Cost','Cost'[EffectiveDate]),FILTER('Cost','Cost'[Product]=('Order'[Product]))) Return CALCULATE(SELECTEDVALUE('Cost'[Cost%]),'Order'[Orderdate]>=MinEffDate &&'Order'[Orderdate] <=MaxEffDate,FILTER('Cost','Cost'[Product]=('Order'[Product]))) Can you please how can I achieve this result. ThanksSolved1.1KViews0likes4CommentsValue from last day (calendar date)
Hello all I have this table and a date filter from calendar table. The date filter is from 5 oct till 11 oct . I want that my measure shows the unit stocks for that last day 11/10 which would be 106 for each SKU column. Thank you all very muchSolved1.2KViews0likes4Comments