Forum Discussion
arkenstones
10 months agoNew Member
Help Needed on LASTNOBLANK dax function
Hi Friends, It may sound silly but im facing a problem in calculating lastnoblank sales date - https://github.com/kumarabhinay/Power_BI/blob/main/LastNoBlank.pbix I should get Jan 3rd as the las...
- 10 months ago
Hi Everyone,
https://github.com/kumarabhinay/Power_BI/blob/main/FirstLastNoBlank.pbix
A simple calculate function over the expression fixed the issue.I tried so hard using AI but failed. This simple tutorial reminded the concept of filter context required for these set of functions to work
Thank you very much!
arkenstones
10 months agoNew Member
Hi Ahmedx,
Thank you for your reply with the suggestions, but i was interesting in getting the lastsaledate using LastNoBlank() dax function. However, i definately learnt something from your solution.
Thank you very much!
Ahmedx
10 months agoSuper User
Ok, pls try this
SalesDate= CALCULATE(LASTNONBLANK('Sales'[Date],CALCULATE(SUM(Sales[SalesAmount]))),'Sales'[Date]<MAX('Sales'[Date]))
----------------
SalesNoBlank= CALCULATE(LASTNONBLANKVALUE('Sales'[Date],CALCULATE(SUM(Sales[SalesAmount]))),'Sales'[Date]<MAX('Sales'[Date]))