Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Fcoatis
Post Patron
Post Patron

Last Value <> from null and 0

Hello everyone,

 

Need some help with a mesure that returns me the last value different from null and zero per category.

 

Here is the sample pbi with a simulated result table expected.

 

Thank you

1 ACCEPTED SOLUTION
Emrah_Külünk
Frequent Visitor

Hi,

You can create a measure like;

 

last value =
var max_date = CALCULATE(MAX('Table'[Dates]),'Table'[Value] <> 0 , ALLEXCEPT('Table','Table'[Category]))
var max_value = CALCULATE(SUM('Table'[Value]) , 'Table'[Dates] = max_date)
return max_value
 
pbi2.png

View solution in original post

4 REPLIES 4
Emrah_Külünk
Frequent Visitor

Here is the sample file.

Fcoatis
Post Patron
Post Patron

Hello, @Emrah_Külünk 

 

Can you post the link of your solution? I tried your mesure in my model and didnt got the same result.

 

Thanks

Emrah_Külünk
Frequent Visitor

Hi,

You can create a measure like;

 

last value =
var max_date = CALCULATE(MAX('Table'[Dates]),'Table'[Value] <> 0 , ALLEXCEPT('Table','Table'[Category]))
var max_value = CALCULATE(SUM('Table'[Value]) , 'Table'[Dates] = max_date)
return max_value
 
pbi2.png

@Emrah_Külünk thank you. It worked!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.