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
sonya7
Helper III
Helper III

How to get the value at the latest date, where values are not 0?

hello, I want to show the last entered value instead of zero values. I was able to find the total number as far as I tried. how can i get the last value?

 
 
 
 
1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

21 REPLIES 21
sonya7
Helper III
Helper III

When I add a filter to the measurement, the month I added disappears because that month is empty. how can i solve this? @Ashish_Mathur 

Hi,

I cannot understand your question.  Clearly show the problem and also the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-luwang-msft
Community Support
Community Support

Hi @sonya7 ,

Create a new column ,and change it to number:

Yearmon = _MonthlyReceipt[Year]&""&0&""&_MonthlyReceipt[Month]

Test the measure like below:

test =
VAR test =
    CALCULATE (
        MAX ( _MonthlyReceipt[Yearmon] ),
        FILTER ( ALL ( _MonthlyReceipt ), _MonthlyReceipt[Receipt] <> 0 )
    )
RETURN
    CALCULATE (
        MAX ( _MonthlyReceipt[Receipt] ),
        FILTER ( ALL ( _MonthlyReceipt ), _MonthlyReceipt[Yearmon] = test )
    )

Output result:

vluwangmsft_0-1659342083961.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

yes it's true but what I want is to print the last filled value to the next empty months, they should remain themselves or the previous months themselves. 

and when i try i see this

Ekran görüntüsü 2022-08-02 164039.png

This is different from your original question.  Zero (0) and BLANK() (null) are different things and need to be handled differently.  Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

this is what i want, thanks 

Ekran görüntüsü 2022-08-03 010326.png

 

Hi @sonya7 ,

Adjust the measure to the below:

test = 
VAR test =
    CALCULATE (
        MAX ( _MonthlyReceipt[Yearmon] ),
        FILTER ( ALL ( _MonthlyReceipt ), _MonthlyReceipt[Receipt] <> 0 )
    )
RETURN   IF(MAX(_MonthlyReceipt[Receipt])<>0,MAX(_MonthlyReceipt[Receipt]),
    CALCULATE (
        MAX ( _MonthlyReceipt[Receipt] ),
        FILTER ( ALL ( _MonthlyReceipt ), _MonthlyReceipt[Yearmon] = test )
    ))

Output result:

vluwangmsft_0-1659489956716.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

 

Since there is no data entered after the 4th month in my montlyreceipt table, I take the date from my dimdate table. I think I'm having trouble here.  and I get a result like this. how can we solve this?  By the way, I want the total to be the sum of the numbers up to the month we are. Thanks

sonya7_0-1659545971359.png

 

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

Download the PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

this worked! thank you. But I want to add all the numbers in total

You are welcome.  What figure are you expecting in the Total row?  Please specify clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I want the sum of all the months I selected in the total number because I will now use it as a receipt. So 37.935.583+(2.168.400*8)

Ekran görüntüsü 2022-08-04 134525.png

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

it was very good and fast! best regards

Thank you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

test = 
var d = max(DimDate[TheDate])
var l = calculate(max(_MonthlyReceipt[TransactionDate]),all(_MonthlyReceipt),_MonthlyReceipt[TransactionDate]<=d)
return  if(year(d)*100+month(d)<>year(l)*100+month(l),CALCULATE(sum(_MonthlyReceipt[Receipt]),all(_MonthlyReceipt),_MonthlyReceipt[TransactionDate]=l))

hi, i tried your size but i couldn't get the result i wanted. thank you so much

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.