"dax" "earliest date"
15 TopicsGantt chart
Creating a Gantt chart using Lingaro visual. However, I do not want it to display past phases (highlighted in yellow), I want it to be centered around today's date (e..g, show phases on or after today's date- shown via the diamond shape). Is this possible? thanks in advance!619Views0likes2CommentsWant to convert a sql function into dax for a direct query
HI, I want to convert the below sql query column into dax for a direct query option. Can you please help how to do that? - SUM(BIDS) OVER (PARTITION BY DRID,INTRL_DATE,PERD_ID ORDER BY BND ASC) as CUM_BIDS - GREATEST(0,BID_AVAIL + LEAST(0,INIAL_MW - CUM_BIDS )) Regards LaiqSolved683Views0likes1CommentNeed help with Dax Measure
Hi, I have facing performance issue with a measure in my power bi report where I have creating the below measure Transaction Count = COUNTROWS ( FILTER ( SUMMARIZE ( 'Compiled Sales', 'Compiled Sales'[Store Code], 'Compiled Sales'[BillNo], "Total", SUM ( 'Compiled Sales'[Sold Quantity] ) ), [Total] > 0 ) ) can this measure be created in another way currently this dax is taking 20 sec and my main fact table has 20 million records. please let me know if any other information is requried.418Views0likes1CommentReturn SUM for newest value by unique ID
Hi all, I'm pretty new to PowerBi but I have got good familarity. I want to return a SUM value (so I can put in a card visual) of a SUM of values only by unique IDs and their latest date of values. This means I can put a date slider which filters the latest SUM values (by unique IDs) in a date range. Example data: ID Amount DateTime 1 10 01/01/2023 1 5 02/05/2023 1 2 01/08/2023 2 15 01/01/2023 2 10 02/05/2023 2 5 01/08/2023 I want to then add a filter slider and if I select January and it only shows the SUM value of 25. But if I change the slider for May it will show me the SUM value of 15. If I set the date slider for the whole of 2023 I want it to only show the latest data which is a SUM of 7. I can create DAX to SUM latest values only but if I change the slider to January there is no data. So I need to be able to create a SUM based on unique IDs only and their latest date based on a filter slider. Many thanks, Liam637Views0likes3CommentsCount first instance in date range
I am trying to count all those that have reached 24 months milestone in a given date range. My data has a row of data per person, per day with a column that indicates months service. So someone will have 24 months service for approximately 30 (give or take) rows. I would like to count just the first time the number 24 appears so I can show, for example, how many people reached this milestone in a given time period. Each period I have is roughly 28 days long so someones 30ish rows of data will likey span more than one period - I want to count them the first period their 24 appears. This is a large data set so a calculated column is to slow. I've gone DAX blind this afternoon so can't see wood for the trees. This is my current attempt (which I know is off) but highlights the route I'm trying to take - I think. #CurrentCustomerAchieving24Months = VAR First24 = CALCULATE( MIN('Data'[DateKey]), FILTER('Data', 'Data'[ServiceLength_Months] = 24 ) ) VAR Counter = CALCULATE( COUNTROWS('Data'), FILTER( 'Data', 'Data'[ServiceLength_Months] = 24 ) && 'Data'[DateKey] = First24 ) RETURN Counter Example Data in the attached. In the attached I would want to be able to count person 12345 in Period 1 and Person 67891 in Period 2 This should be a link to the very simplified example https://we.tl/t-Fse9l24Jn9Solved692Views0likes2CommentsPrevious datetime for streaming dataset
Hi, I have streaming dataset. Requirement is to show live data. To perfrom some calculations I connect this dataset to powerbi Desktop and adding measures as per need. Now I am trying to create a measure which will give me perivous value of datetime. I want time diffrence of two entity. Please check below image. In this case I want new column with perivous datetime. I want to calculate time diffrence of non Blank ESN value to next stopper_down_time_Stamp. I tried one measure- CALCULATE(index(-2,ALLSELECTED('live-table'[HosurDateTime]),ORDERBY('live-table'[HosurDateTime],ASC)),KEEPFILTERS('live-table')) But this is giving me only one value for latest record. not complete column values. Please help me out. Thanks.Solved392Views0likes1CommentCalculate a date sequence on a row level per ID (in DAX)
Hi there, I have this data set where each patient goes through different treatments (each row is a new treatment). I would like to add a new column (using DAX) that creates a sequence of numbers from 1 to "N" for each Patient, being 1 assigned to the earliest date. This is what the new column should look like: Patient Created on (d/mm/yyyy) Treatment number (calculated column) Patient A 16/08/2023 3 Patient A 5/05/2023 2 Patient A 25/03/2023 1 Patient B 13/08/2023 2 Patient B 5/05/2023 1 Patient C 19/06/2023 1 Patient D 8/09/2023 2 Patient D 14/07/2023 1 Thanks!Solved640Views0likes2CommentsFind the earliest success request
Hello all, I need to filter or flag the earliest requests that resulted in success. For example a meter id has 2 update requests. First request on 2023-03-10 12:40:34 and its status is "Success". The second update request is at 2023-03-10 15:34:23 and its status is also "Success". Now I want to consider only the first update request and ignore the second request row. Suppose the first update request resulted in "Failure", then it should consider the second update request as the earliest successful request. Here is the sample data meter id request id type request date status earliest date date Consider 100A 1A Update 2023-03-10 12:40 success 2023-03-10 12:40 1 100A 1B Update 2023-03-10 15:50 Success 2023-03-10 12:40 0 200B 1C Update 2023-03-15 10:20 Failure 2023-03-15 14:30 0 200B 1D Update 2023-03-15 14:30 success 2023-03-15 14:30 1 I did a DAX code for this as follows: earliest success date = VAR request_type = 'table_update'[type] VAR meterid = 'table_update'[meter_id] RETURN MINX( FILTER('table_update','table_update'[meter_id]=meterid && table_update'[type]=request_type && 'table_update'[status]="Success"), 'table_update'[request_date] ) To flag the earliest success request: I create another calculated column: date consider = IF('table_update'[request_date] = 'table_update'[earliest success date],1,0) But when I implement this code I get the below result: meter id request id type request date status earliest date date Consider 100A 1A Update 2023-03-10 12:40 Success 2023-03-10 12:40 1 100A 1B Update 2023-03-10 15:50 Success 2023-03-10 12:40 0 200B 1C Update 2023-03-15 10:20 Failure 2023-03-15 10:20 1 200B 1D Update 2023-03-15 14:30 Success 2023-03-15 10:20 0 Instead I need the earliest success date for meter id 200B to be 2023-03-15 14:30 as it is the first success. What am I missing? Could anyone please point me what is missing from this piece of code. Please. Thank you very much.Solved930Views0likes4CommentsNeed help improving DAX calculations for accurate results in Power BI from single date column!
Hello Power BI community! I'm seeking your expertise to help me improve two DAX calculations that I'm currently using to calculate the receiving and sending (handling) dates for a ticket table. The data I'm dealing with is related to a list of tickets that are received and then treated by technicians on different dates, unfortunately, I'm only provided with one date column which aggregates all actions performed on a specific ticket (which is DateTime), and a ticket may appear repetitively but with different receiving and sending dates (which should be taken into account of course). Here's a snapshot from the raw data table: Feel free to download these tables from here: "https://smallpdf.com/file#s=c745e973-29a0-4dbd-85ab-2472d7379858" Below are the DAX calculations I'm using to produce the results (which are now inaccurate) ReceiverDate = CALCULATE( MIN(WEEKLY_IDs[DateTime]), FILTER( ALL('WEEKLY_IDs'), 'WEEKLY_IDs'[SenderID] = EARLIER('WEEKLY_IDs'[ReceiverID]) && 'WEEKLY_IDs'[ReceiverID] = EARLIER('WEEKLY_IDs'[SenderID]) && 'WEEKLY_IDs'[Ticket_ID] = EARLIER('WEEKLY_IDs'[Ticket_ID]) ) ) SenderDate = CALCULATE( MAX([DateTime]), FILTER( ALL('WEEKLY_IDs'), 'WEEKLY_IDs'[SenderID] = EARLIER('WEEKLY_IDs'[SenderID]) && 'WEEKLY_IDs'[ReceiverID] = EARLIER('WEEKLY_IDs'[ReceiverID]) && 'WEEKLY_IDs'[Ticket_ID] = EARLIER('WEEKLY_IDs'[Ticket_ID]) ) ) These are the end results I'm seeking to accomplish with these two DAX calculations:382Views0likes0CommentsCalculate the total average days
Hello community! I am stumped. So I am trying to do a "conversion" rate based on a start date from one table and a start date from another table. These two tables do not have a direct relationship, however, they are both connected to a main table through an ID. The main table includes the slicer # and the main table ID #. I am using a DAX where I pull the minimum date value based on the start date of each table, then I am using a datediff between those two minimum values. What I need is for the sum of those conversion days for all of the main table #s and then I will divide that number by the count of main table IDs. Here's an example. Instead of it showing -254 I need it to total eveything in that table in order for me to divide it by the count. Hopefully this wasn't too confusing, Thanks!Solved844Views0likes2Comments