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
dhannaa
Helper IV
Helper IV

Area chart - stop counting the stock amounts after last stock movement

 

Is there a good way to overcome the problem below? My chart is showing cumulative stock and it is totally correct with the last horizontal line as there are no stock movements anymore. 

 

However, I would prefer line to end completely at its last value.  

 

I did modify my  formula to return zero after today but it didn't work the way I wanted. I want no value at all instead of zero.

 

 

AccumulatedValue = 
IF(
    TODAY()<=MAX('Calendar'[Date].[Date]);
    0;
    (CALCULATE (
    SUM ( 'Item Ledger Entry'[Quantity] );
    FILTER ( ALL ( 'Calendar' ); 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ))
))

 

Sieppaa.PNG

 

Jenny

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

@dhannaa,

 

Hi Jenny,

 

Just try to delete .[Date] from your formula. It should work.

AccumulatedValue = 
IF(
    TODAY()<=MAX('Calendar'[Date].[Date]);
    0;
    (CALCULATE (
    SUM ( 'Item Ledger Entry'[Quantity] );
    FILTER ( ALL ( 'Calendar' ); 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ))
))

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
v-jiascu-msft
Employee
Employee

@dhannaa,

 

Hi Jenny,

 

Just try to delete .[Date] from your formula. It should work.

AccumulatedValue = 
IF(
    TODAY()<=MAX('Calendar'[Date].[Date]);
    0;
    (CALCULATE (
    SUM ( 'Item Ledger Entry'[Quantity] );
    FILTER ( ALL ( 'Calendar' ); 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ))
))

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks,

 

but unfortunately Power BI doesn't let me do it. If I delete .Date, application gives me a dropdown and I have to choose Date/Day/Month/or something similar.

 

Jenny

Hi Jenny,

 

That's kindly tips from Power BI. You can ignore it and add the right parenthesis directly. Give it a try please.

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks - that works! 

 

I didn't see the possibility I could ignore the dropdown 🙂

 

Jenny

@v-jiascu-msft

 

One more question regarding this. I replaced zero with BLANK() as I confronted some problems with zero values. Blank looks better but comes with a new problem as axis ends always at the end of the data -> I would want axis to continue till the end of year although there is no data for the last months.

 

Jenni

Hi Jenny,

 

Try "Show items with no data" please.

 

Area chart - stop counting the stock amounts after last stock movement.jpg

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Can you share your example file? This seems as a simple solution,  but I just can't get it work.

 

Jenni

Hi Jenni,

 

Check this file please.

 

Area chart - stop counting the stock amounts after last stock movement2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-jiascu-msft!

 

I do get the wanted result with table but as I turn it into area chart only data with values is drawn to chart. Get the same effect with your sample file:

 

Sieppaa.PNG

 

End result is kind of misleading, as the chart is not showing the fulle year, only values till today. As dates after today would not exist 🙂

 

Jenny

 

 

Hi Jenny,

 

Try this option please.

 

Area chart - stop counting the stock amounts after last stock movement3.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.