Forum Discussion

GINMED's avatar
GINMED
Icon for Helper III rankHelper III
4 years ago

FIRST & LAST payements

Hi, I have created project for loan depreciation, but there is some other expences to calculate, for example, casco insurance.

But I can't to get right measure to calculate - how to switch first and last payment for each loan item?

 

There is my data.

Thank you in advance for support.

 

 

2 Replies

  • v-easonf-msft's avatar
    v-easonf-msft
    Icon for Community Support rankCommunity Support

    Hi, GINMED 

    Not fully sure what is your question, can you tell us a bit more about what exactly you were doing?

    Best Regards,
    Community Support Team _ Eason

    • GINMED's avatar
      GINMED
      Icon for Helper III rankHelper III

      v-easonf-msft 

      I have created project for payments per item.

      And then I should calculate some expences, where I have such measure

       

      VAR firstP = MINX(ALLSELECTED('Līgumi_Project'), ('Līgumi_Project'[Sequence]))
      VAR lastP = MAXX(ALLSELECTED('Līgumi_Project'), ('Līgumi_Project'[Sequence]))
      VAR CurrentSeq = SELECTEDVALUE('Līgumi_Project'[Sequence])
      VAR CurrentP = SELECTEDVALUE('Līgumi_Project'[KASKO])

      VAR result =
      SWITCH(
      CurrentSeq,
      firstP,[KASKO_FIRST],
      lastP,[KASKO_LAST],
      CurrentP
      )
      RETURN result
       
      but this one does not work for each item, it shows incorect LAST PAYMENT