lastnonblank
13 TopicsCurrent and LASTNONBLANK results
Hello, I have this measure which gives me the percentage results for the currently filtered months: overall_% = SELECTEDVALUE(a_fact_results[no_responses])/SELECTEDVALUE(a_fact_results[base]) I want to display the previous LASTNONBLANK results in a new column. How can I alter the code to display this?769Views0likes4CommentsCreate a new Table with only the last Case steps from a existing Table
Hi, i´ve been trying to create a new Table using the Summarize(), Addcolums() and Lastnonblank() function. I have a table called "Bearbeitung" which lists all cases with their single steps, this table is sorted in Querry by date (increasing). I want to create a new Table called "letzte Bearbeitung" which lists for every distinct case "Vorgangs_ID" the the last step based on the last time it was edited. I ran into an error. My code doesnt work right. The LASTNONBLANK() funktion wont give the last result for ID_Nonth_UserID and Status_after_Handling. Don't know why, what am i doing wrong here? Is there maybe a better solution using the GROUPBY() function?489Views0likes1CommentGet the value for the previous non blank date
Hi everybody, I'm trying to calculate a Day On Day Change for a set of stocks. The thing is, when it comes to getting the previous day value, there are sometimes where Dax returns me a blank value since there's a weekend in between. I guess this is because my formula has flaws... I'd like just to have the previous day value as it happens when it's labour day. Formula and tables are: Latest ULSD 10ppm MED (€/l) = CALCULATE ( AVERAGE('ULSD 10ppm CIF MED'[Litres EUR Prevat]), FILTER ('ULSD 10ppm CIF MED', 'ULSD 10ppm CIF MED'[Date] = CALCULATE ( LASTNONBLANK ( 'ULSD 10ppm CIF MED'[Date], 1 ), FILTER ( 'ULSD 10ppm CIF MED', 'ULSD 10ppm CIF MED'[Date] <= LASTDATE( 'ULSD 10ppm CIF MED'[Date]))))) PR ULSD 10ppm MED CIF Cargoes (€/l) = IF(ISBLANK([Latest ULSD 10ppm MED (€/l)]), [Latest ULSD 10ppm MED (€/l)], CALCULATE ( AVERAGE('ULSD 10ppm CIF MED'[Litres EUR Prevat]), PREVIOUSDAY('CALENDAR'[Date]))) DoD Change ULSD 10ppm MED CIF Cargoes (€/l) = Var Division = DIVIDE([Latest ULSD 10ppm MED (€/l)] - [PR ULSD 10ppm MED CIF Cargoes (€/l)], [PR ULSD 10ppm MED CIF Cargoes (€/l)]) Return Division Expected Results are: Date Litres EUR Prevat (Current) Prev. Value DoD 02/06/2023 1.0618 1.0542 0.0072 01/06/2023 1.0542 1.0411 0.0126 31/05/2023 1.0411 1.0453 -0.0040 30/05/2023 1.0453 1..0591 -0.0130 29/05/2023 1.0591 1.0598 -0.0006 26/05/2023 1.0598 1.0508 0.0086 Appreciate any help.Solved1.4KViews0likes2CommentsLastnonblank not returning correct results
I'm trying to return the last non-blank row of the "Target stage outcome" column based on the "Entity" column. However, using the lastnonblank dax formula is not yielding the correct results. I have attached the example fact table below. Here is the results that I'm trying to get are those in the red box: I've created a summary table to see the results Despite the "Index" and "Last day" returning the correct results, the "Stage" field is not returning the correct result. This is the "Target" table that I'm using in my summary table above I would appreciate if someone could help me here. ThanksSolved1.6KViews0likes5CommentsLast non blank help
Hi All, Hoping someone can help give me some advice on this one. I have done some research but can't quite work out the correct way to use LastNonBlank. I have two tables, one that lists products and when work has been done with them, and another table that is going to be used as a dataset for a report. Table 1 contains some key dates I need based on a product ID however that product ID can appear multiple times. Example of what this table looks like below: Product ID DateCreated DateCompleted 54179 28/07/2022 17/08/2022 711133 31/07/2022 17/08/2022 801371 01/08/2022 19/08/2022 801371 01/08/2022 23/08/2022 711133 01/08/2022 801371 03/08/2022 24/08/2022 102333 06/08/2022 14/08/2022 102333 06/08/2022 14/08/2022 704112 10/08/2022 15/08/2022 What I need is to pull out the last date where something was completed for this product. Other dates for each product can be ignored so I think LASTNONBLANK should give this to me but I need to select the last completion date for each unique product ID. In my second table I have the unique Product IDs and I want to eventually get the last date that something was completed added to that table as a lookup. What I want to end up with is something like the below: Product ID DateCompleted 54179 17/08/2022 711133 17/08/2022 801371 19/08/2022 102333 14/08/2022 704112 15/08/2022 Is anyone able to help me with this? Thank you in advance for your help!Solved667Views0likes2CommentsLastNonBlankValue ?
This is how the table looks like in Power BI.My goal is to fill up the blank comments (where IsCurrentVersion=1) with last non-null value for the same ID. For example, the blank comment row for ID 6355 where IsCurrentVersion=1 should be populated with “Hi, Richard is asking for accedd on the Bed Capacity Tracking” site". For ID 6360, latest row should remain blank because there’s no previous non-null value . For 6362, latest row should be “Sent an MN to tier 2 for the ticket” For 6379, latest row should be “Added roles for all” To achieve this, I tried to use the LASTNONBLANKVALUE function. My formula is here : Column = IF (‘’Sheet1’IsCurrentVersion]=1 && ‘Sheet1’ [Comments]="", LASTNONBLANKVALUE(' Sheet1'[Last_Modified],'sheet1'[_Comments])) But this formula won’t work because my Date column is not standard. It doesn’t have all the dates in a year. So I tried to add a custom column Then fill up Obviously that didn’t work either because it doesn’t understand the Grouping of ID’s. For example For ID 6360, latest row should remain blank because there’s no previous non-null value for that particular ID . Can anyone advice on groupoing/ filling down or any other custom column method? https://1drv.ms/x/s!Apg-ha77_EillQlnj2TCAhNPDhvg?e=zQ1w7ZSolved2.2KViews0likes3CommentsLASTDATE Not working as required
Hi guys, I am trying to retrieve the most recent QTY On Hand for each product in my inventory but the trouble I am having is that for whatever reason, some of these products can be present on multiple order lines of the same order with the same order date and time making it difficult to calculate the most recent QTY On Hand. Below, is an example of such case. My formula is the following : LAST INVENTORY VALUE = VAR X = CALCULATE(MAX(INTRAN00[TXQOH]),LASTNONBLANK(INTRAN00[TRANSACTION DATE],1)) RETURN X Highlighted in Green is the value I want to retrieve but my formula currently retreives 298. But , Based on the time reference (TXTIME) the most recent transaction is 7394480 *TXORD#) focusing on the last line (TXLINE) of that order which is 4. So essentially my formula needs to take into account order time as well as the very last line number in instances such as these. Any recomendations ?1.1KViews0likes1CommentReturn last non-blank string value of ticket (probably) with LASTNONBLANK
I am struggling with getting only the last non blank value for each ticket. In the Power Pivot measure, I have used a function LASTNONBLANK() , but the outcome was not reliable - probably because data model does not consider the original order of rows. Excel formula or VBA is not an option and Power Query is not very efficient because of big load of data. ticket step timestamp value 1 1 7/28/2021 04:15 PM 1 2 7/28/2021 04:23 PM a 1 3 7/28/2021 04:30 PM 1 4 7/28/2021 04:37 PM b 1 5 7/28/2021 04:44 PM 1 6 7/28/2021 04:51 PM 1 7 7/28/2021 04:59 PM 2 1 7/29/2021 01:51 PM a 2 2 7/29/2021 02:49 PM b 2 3 7/29/2021 03:47 PM c 2 4 7/29/2021 04:44 PM 2 5 7/29/2021 05:42 PM a 2 6 7/29/2021 06:39 PM For ticket "1", the returned value should be "b" (step 4) and for ticket "2", the returned value should be "a" (step 5). ticket value 1 b 2 aSolved913Views0likes2CommentsEvolution of value per id filtering by date
Hi, I have been investigating on the forum but still have some issues. I have a table like this: Id Date Value 1 1/1/2020 Prospect 1 2/2/2020 Lead 1 5/5/2020 Opportunity 2 3/3/2020 Prospect 2 4/4/2020 Lead 2 7/7/2020 Opportunity I need a measure that shows the last value by id filtering by month. For example, if I select march/2020 I need to have something like: Id value 1 Lead 2 Prospect Then, I need to display a chart that shows the number of distinct id´s per value filtering by month If I select 5/5/2020, I need to see something like: Value Count of id Prospect 0 Lead 1 Opportunity 1 This means, we count the number of id´s per value, depending on the last value of an id at a certain date2KViews0likes6Comments