March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi dear community,
I am new on Power BI Desktop and I need some help!
I've got a metric named "number of people" that can't be cumulated.
I want to return the last value of the column "number of people".
In fact, I import a database that provide the details of the number of people every day of the month. However, I don't have the number of the month provided, as the format of the date is "month - year" and can't be changed for some reasons.
To be clear, the file is presented like this:
february; 23
february; 29
february; 19
Thus, I want to return the last value of the column (19) which is in fact the last value of the month.
Can you please help me with this?
Thanks a lot in advance!!!
Solved! Go to Solution.
If these are only Feb, then I think it is difficult. But if they are dates then you can do it easily.
There is very powerful function as part of Feb 2020 release that can help - lastnonblankvalue
https://docs.microsoft.com/en-us/dax/lastnonblankvalue-function-dax
lastnonblankvalue(Date,max(Table[Value])
Hi @matrin ,
If you want to get the last value of a column, you can try the following DAX.
Measure = CALCULATE(LASTNONBLANK('Table'[Column2],1),ALL('Table'))
If the problem persists,could you please share sample data or sample .pbix?
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share data for more months/year column/index column and shoe the expected result clearly.
Hi @matrin ,
If you want to get the last value of a column, you can try the following DAX.
Measure = CALCULATE(LASTNONBLANK('Table'[Column2],1),ALL('Table'))
If the problem persists,could you please share sample data or sample .pbix?
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If these are only Feb, then I think it is difficult. But if they are dates then you can do it easily.
There is very powerful function as part of Feb 2020 release that can help - lastnonblankvalue
https://docs.microsoft.com/en-us/dax/lastnonblankvalue-function-dax
lastnonblankvalue(Date,max(Table[Value])
Thanks for your help.
In fact, I don't want the maximum value but the very last one of the column.
You're probably right, it won't work without days...
Hi @matrin ,
With the formula I created, I can get the desired results in my test data.
If the problem persists,could you please share sample data or sample .pbix?
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |