Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
How do I retreive a value of a column based on the most recent date of another column ?
Solved! Go to Solution.
Hi @Kolumam
replace [Last_Date] in the last line with just secondLast_Date
secondLast_Date should be without brackets because it is the variable in the same formula
Hi @Kolumam
Do you mean Column or Table?
Please could you paste 5-6 rows of sample data and expected result?
So there are two columns here. The measure should display the value of "Percentage Solar over Load" based on the most recen date (i.e. 27/11/2017)
HI @Kolumam
Please try these MEASURES.
I am assuming Percentage Solar Over Load is a MEASURE
LastDate = LASTDATE ( ALL ( Table1[Date] ) )
%age on LastDate= VAR Last_Date = LASTDATE ( ALL ( Table1[Date] ) ) RETURN CALCULATE ( [Percentage Solar over Load], Table1[Date] = Last_Date )
Hi Zubair,
Percentage Solar over load is just a column from excel sheet.
Hi Zubair
Instead of retreiving the value based on the most recet date, is it possible to retreive based on yesterday date ? (26/11/2017)
Hi @Kolumam
Just Wrap LastDate with PreviousDay
Last_Date = PREVIOUSDAY(LastDate(All(Table1[Date])))
SecondLastDate = PreviousDay(LASTDATE ( ALL ( Table1[Date] ) ))
%age on SecondLastDate= VAR SecondLast_Date = PreviousDay(LASTDATE ( ALL ( Table1[Date] ) )) RETURN CALCULATE ( [Percentage Solar over Load], Table1[Date] = SecondLast_Date )
Not sure why it is able to find the column ?
So its a Column. I thought its a MEASURE
Use Calculate(sum(Meter REadings[Percentage Solar Overload])
calculate cannot have simple columns as arguments
It gives me this error now.
Hi @Kolumam
replace [Last_Date] in the last line with just secondLast_Date
secondLast_Date should be without brackets because it is the variable in the same formula
I realized the mistake yesterday itself. Thanks for your immense help.
Hi Zubair,
The formula that you suggested a few months back is not working now. all of a sudden it has gone blank. It says data format is not supported.
Could you please help me with my query ?
http://community.powerbi.com/t5/Desktop/Error-with-DAX-formula/m-p/338849#M151633
Thanks
Krishna
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
113 | |
69 | |
59 | |
46 |