Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Friends,
I was trying to insert "Last Result" using some Ifs Dax Function, but the result is always "Not Done" or Errors.
I just want to have in "Last Result" the last data in previous columns that are not "Not Done" and if all previous columns have "Not Done" so insert it.
I tried to search a solution in forum but I didn't find it.
Below an example table of what I want from my formula:
Thanks for all of you that want to help me.
Solved! Go to Solution.
Use below in a custom column in PQ
= [l=List.FirstN(List.RemoveItems(List.Reverse(List.RemoveFirstN(Record.ToList(_),1)),{"Not Done"}),1), r=if List.IsEmpty(l) then "Not Done" else Text.Combine(l)][r]
Hi @Anonymous,
Add a custom column, add code below:
Replacer.ReplaceValue(List.Last(List.Select(List.Skip(Record.ToList(_),1), each _ <> "Not Done")),null,"Not Done")
Regards
KT
Please can you provide an example table of the input data and desired output report.
You can do this using copy and paste.
Do not send a screen prints.
Tables are much better because can import date and create an example solution.
Hi @speedramps ,
Thanks for your reply!
My raw data is like this table:
Name | May Survey Result | June Survey Result | July Survey Result | August Survey Result |
User1 | Not Done | Not Done | Good | Not Done |
User2 | Not Done | Good | Bad | Not Done |
User3 | Good | Bad | Good | Bad |
User4 | Bad | Good | Not Done | Not Done |
User5 | Not Done | Not Done | Not Done | Not Done |
I want to create in PBI another column that has result of the last column with "Good" or "Bad" and if there isn't any "Good" or "Bad" insert "Not Done" (as the table that I sent in the post).
Thanks!
Use below in a custom column in PQ
= [l=List.FirstN(List.RemoveItems(List.Reverse(List.RemoveFirstN(Record.ToList(_),1)),{"Not Done"}),1), r=if List.IsEmpty(l) then "Not Done" else Text.Combine(l)][r]
Hi Nycso94
Try this and click thumbs up and Accept As Solution please !
@Anonymous Is that how your raw data looks? If so, I highly recommend that you unpivot your month columns in Power Query and add an index or something so that you can determine which rows are earlier or later.
Hi @Greg_Deckler ,
Thanks for your reply!
Yes, my raw data are that.
For my purpose is no matter if columns are dates or something else.
The importance is "Last Result" give me the last column (in orange table, because they are ordered correctly) that is "Good" or "Bad" and if there is no column with that 2 result so give me "Not Done".
Now I don't know if your suggest fit with my reply.
Thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
8 | |
7 | |
6 |