Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi everyone...
I would like to create a column that returns the most recent date from my table (the month column), per projectid, where there are charges. Please see below. In this example the most recent date would be 9/1/2020 and I'd like to bring that value in to a table visualization. There are multiple projectids in the data and there are 0 values in many cases and I'm thinking I will need to use the LASTDATE function along with ALLEXCEPT.
Any help here is appreciated!
Solved! Go to Solution.
Hi @bchager6 ,
You can use the below DAX in a new measure to get latest date for ProjectIDs:
Max Date of ProjectID = CALCULATE(MAX('Table'[Month]),ALLEXCEPT('Table','Table'[ProjectID]))
Reference Image:
Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!
Hi,
So in another column of the same viz, you want to show 0.02 in all rows where the project id is 89. Am i correct? Please share the download link of your PBI file with cases where the value is 0. Please also show the expected result.
@Ashish_Mathur Thanks for your response, but no actually. In another column I want to note which date is the latest date for a project which has costs associated. So I think I'd need to add a condition to @Anand24's solution where the expression would first check to see if the value field is <>0.
CALCULATE(MAX('Table'[Month]),ALLEXCEPT('Table','Table'[ProjectID]))
Hi @bchager6 ,
You can use the below DAX in a new measure to get latest date for ProjectIDs:
Max Date of ProjectID = CALCULATE(MAX('Table'[Month]),ALLEXCEPT('Table','Table'[ProjectID]))
Reference Image:
Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!
@Anand24 Thanks for your help. I just added the bold faced code below to what you sent me and it accomplishes what I want it to.
@Anand24 Thank you. That should help but it also needs to consider whether the particular date contains a value. In my example, 9/1/2020 could be zero, where the most recent date with values would be 8/1/2020.
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |