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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Kote101
Helper II
Helper II

Move Calculated Column value ahead in time?

Hi guys, i need help moving my calculated column calculation value (can be a measured if needed) into month ahead of it. The image below should make things clear.

Instead of having my target line (the red line) show up as 1 (the calculated value ) on April 2019, i would like it to copy the value of the planned line for April 2019 and replace the planed value (5) on march 2019 to 1 (the calculated value). The idea is as i input data, the calculation portion of my dax will run for the following month.


Target = 

IF(OR(NOT(ISNUMBER('Data Table'[Actual])),'Data Table'[Planned]='Data Table'[Actual]),'Data Table'[Planned],DIVIDE('Data Table'[Planned]-'Data Table'[Actual],'Data Table'[Planned]) *'Data Table'[Planned] + CALCULATE(SUM('Data Table'[Planned]),NEXTMONTH('Data Table'[Fiscal Dates])))

Heres my calculated column. The if statement allows me to emulate the planned values so that my target line is equal planned values except when my input data goes above or below my planned values. If this is the case the second part of the if statement instigates a calculation that alters the amount i would need in the following month to keep me on track of my plan.

Heres a link to my pbix and excel file : https://filebin.net/qlgusdv2f3w0pfm4

1 ACCEPTED SOLUTION

@Kote101,

 

You may refer to the following code.

Column =
IF (
    CALCULATE (
        SUM ( 'Data Table'[Actual] ),
        PREVIOUSMONTH ( 'Data Table'[Fiscal Dates] )
    )
        <> BLANK (),
    'Data Table'[Planned]
        + CALCULATE (
            SUM ( 'Data Table'[Planned] ) - SUM ( 'Data Table'[Actual] ),
            PREVIOUSMONTH ( 'Data Table'[Fiscal Dates] )
        )
)
Community Support Team _ Sam Zha
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

3 REPLIES 3
ryan_mayu
Super User
Super User

@Kote101

 

I only see 0 value for Mar and Apr in your example. Could you please let me know what is the result you expected. You can just give a simple example in excel file.

 

Are you trying to move the target value one month earlier?

Column = CALCULATE(SUM('Data Table'[Target]),DATEADD('Data Table'[Fiscal Dates],1,MONTH))

 

 

c1.JPG





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

Proud to be a Super User!




@ryan_mayu, thank you for your response, i have created a new file in this link; https://filebin.net/qlgusdv2f3w0pfm4,  called test data example.

In this excel file you can see an example of how the data should progress as i input in values. For the two starting 0 values in the first two months, if the planned and actual are equal then the target (the dax) should just input 0, and for any dates above the last input value (look in the excel example file ) they should be automatically 0 too. I hope this clears it up.

@Kote101,

 

You may refer to the following code.

Column =
IF (
    CALCULATE (
        SUM ( 'Data Table'[Actual] ),
        PREVIOUSMONTH ( 'Data Table'[Fiscal Dates] )
    )
        <> BLANK (),
    'Data Table'[Planned]
        + CALCULATE (
            SUM ( 'Data Table'[Planned] ) - SUM ( 'Data Table'[Actual] ),
            PREVIOUSMONTH ( 'Data Table'[Fiscal Dates] )
        )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.