Forum Discussion

amksnpower's avatar
amksnpower
New Member
3 years ago
Solved

Need Dax help

hi,

 

 I am having data from 2017 for claims. i need to do mature warranty calculation ( in Excel I use the Edate to get a back date based on that date will sum claims & divide by production to get mature warranty percentage) similar I need the Dax function to calculate the same.

 

Example: product supplies from Jan'2017. the warranty of the product is 15 months. if I want to calculate mature warranty 

July'23 - 15 months i.e. Apr'22. so will calculate the claim from Jan'2017 to Apr'22 & divide the supplies for the same period to get mature warranty percentage. is mean till Apr'22 supplies warranty is completed & we won't get claims.  pls help me to get the dax for the same

 

 

  • Dear Community Team, thank you for the replay & DAX. will try & update you

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi amksnpower ,

    Please have a try.

    Mature Warranty % =
    VAR CurrentDate =
        TODAY ()
    VAR WarrantyPeriod =
        15 - MAX ( table[change this to your desired warranty period in months ] )
    VAR MatureDate =
        EDATE ( CurrentDate, - WarrantyPeriod )
    VAR Claims =
        CALCULATE (
            SUM ( Claims[Amount] ),
            FILTER ( Claims, Claims[Date] <= MatureDate )
        )
    VAR Supplies =
        CALCULATE (
            SUM ( Supplies[Quantity] ),
            FILTER ( Supplies, Supplies[Date] <= MatureDate )
        )
    RETURN
        DIVIDE ( Claims, Supplies )
    

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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

     

     

     

     

    • amksnpower's avatar
      amksnpower
      New Member

      Dear Community Team, thank you for the replay & DAX. will try & update you

      • amksnpower's avatar
        amksnpower
        New Member

        Dear Bro,

         

        it is working, I dynamically changed the Edate formula, claims, and supplies. Thank you.

         

        need support as I made claims & supplies linked with the Date table to get the date common. but I cannot use that Date table, please help me with that. The date table created a relationship with claims and supplies.