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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ingpiolo
Frequent Visitor

calculation using Previous value empty

Hi everyone,

I have a table like this:

47937ce2-f505-45d1-86f5-6551a6d4a4cd.jpg

 

I should calculate subsequent fields as indicated iteratively by associating a measure (Filled fields are final values while empty ones are an estimate of future values based on the selection of a parameter).

Do you have any suggestions?

Many thanks

6 REPLIES 6
JoeBarry
Solution Sage
Solution Sage

Hi @ingpiolo 

 

To get the previous months data try this 

Previous Month = CALCULATE(SUM('Table'[Valore]), DATEADD('Table'[Date], -1, MONTH))

 

I would think then that you should create a new measure 

[Previous Month] + [YourMeasure]

 

 

JoeBarry_1-1693471635076.png

 

Thanks

Joe

 

If this post helps, then please Accept it as the solution

 

 

Thanks Joe for the reply.
The problem is that I have empty cells and therefore with the measure
Previous Month = CALCULATE(SUM('Table'[Value]), DATEADD('Table'[Date], -1, MONTH))

I get correctly only the next first value referring to 01/07/2023.
Subsequent ones should resume the value at 01/07/2023 which is saved as a measure. This is the result I would like to get

 

example.jpg

Anonymous
Not applicable

Hi @ingpiolo ,

I created a sample pbix file(see the attachment), please find the details in it.

Result = 
VAR _seldate =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _maxdate =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER ( ALLSELECTED ( 'Table' ), [Sum of value] > 0 )
    )
VAR _value =
    SUMX (
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _maxdate ),
        [Sum of value]
    )
VAR _measures =
    CALCULATE (
        SUM ( 'Table'[Measure] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] <= _seldate )
    )
RETURN
    IF (
        ISBLANK ( SELECTEDVALUE ( 'Table'[Measure] ) ),
        BLANK (),
        _value + _measures
    )

vyiruanmsft_0-1693906539399.png

Best Regards

 

thanks a lot for the support.

I tried but unfortunately I didn't succeed. I am attaching the file to clarify my situation.

Thanks for your support

 

https://drive.google.com/file/d/15fXdGIKlAwNIQbEWUGQow9kBN0DCmZZm/view?usp=drive_link 

Anonymous
Not applicable

Hi @ingpiolo ,

It seems that I have no access to your shared file, could you please grant me the proper permisson to it? Thank you.

Best Regards

Ok, I should have unlocked access. you can check?

Thank you

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.