Forum Discussion

walt20221's avatar
walt20221
Frequent Visitor
3 years ago

Substract 2 columns created through power bi matrix - comparing 2 weeks

Hello team, I am just starting with Power BI and I know this is not something new for you but I got some issues trying to acomplish this task.

 

I have a matrix visualization in power bi where I want to present open balance for customers comparing 2 weeks and at the end be able to see the substraction between the weeks per customer.

 

This is my visual:

 

 

 

I did create a measure, however the measure is summing the values instead of applying substraction.

here is the measure that I am using:

 

Difference11 =
VAR thisweeknumber =
    MIN ('Calendar'[Week No])
VAR thisAmt =
    SUM (Sheet1[Amount Due Original])
var lastsweeknumber=CALCULATE(MAX('Calendar'[Week No]),FILTER(ALLSELECTED('Calendar'),'Calendar'[Week No]< MAX('Calendar'[Week No])))
VAR lastAmt =
    CALCULATE (
        SUM (Sheet1[Amount Due Original]),
        'Calendar'[Week No] = lastsweeknumber
    )
RETURN
thisAmt  - lastAmt

 

 

 

 

Please will be great if you can give me a light on this. Thank you so much.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi walt20221 ,

    I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting and desensitized example data.

    Thanks for your efforts & time in advance.

     

    Best regards,
    Community Support Team_Binbin Yu