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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need Help on DAX to caculate the active warranty products

Dear Champions,

    I am a new power bi user, working on a task to calculate the active warranty for various periods.  I hope your kind help to get below DAX done.

    the table is an install base report for a VIP account that has three fields:  [serial no],  [warranty_start_date], and [warranty_end_date]. there are 50k+ records on this table,   all the records are distributed from the year 2008 to 2022.  the warranty period (that is [warranty_end_date]-[warranty_end_date] is not a fixed number,  it may be 36 months/39 months/48months...../60months.

 

    my target is to calculate the total number of active warranty products for EACH QUARTER END of all the years(from 2008 to 2022). active warranty means the [serial no] begins its warranty on [warranty_start_date], and expires its warranty on [warranty_end_date].

 

    I tried to use DAX below but it is not the right answer:

    InWarranty =

VAR LastDay = MAX(Calender[Date])
VAR Active_Warranty = FILTER(asset,asset[warranty_start_date]<=LastDay&&asset[warranty_end_date]>=LastDay)
RETURN COUNTROWS(Active_Warranty)

    the number of each quarter end is actually the number of new downloaded products of this quarter.

 

   This problem disturbed me for quite a few days, but I have no answer to resolve, is any one can help?  thanks in advance. 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User
3 REPLIES 3
Anonymous
Not applicable

Hi, Amit,

  thanks,  it works. Although I have not fully understood this logic(it seems to need a long way to go), the number is right.    I accepted the https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr... as the solution.  thanks for your help.  

amitchandak
Super User
Super User

Anonymous
Not applicable

Hi, Amit, 

thanks for your reply, I will look into this employee case,  and will feedback to you. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.