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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Calculate failure rating in specific periods

I need help calculating failure ratings for specific dates. The query I have calculates the failure rating for each part number taking into account the Total Usage vs Total Warrantied, but does not calculate it for a specific month, year, or other period of time.

The Syntax used is:

% Total Failed =
var partsfailed = SUM(Warranty[Part Qty])
var totalparts = SUM(Usage[USAGE])
var rate = partsfailed/totalparts
return IFERROR(rate,0)
These are the results of the query
lopezeal_0-1638288995927.png

This is data #1

lopezeal_1-1638289099411.png

Data #2

lopezeal_2-1638289187390.png

Relationships

lopezeal_3-1638289225746.png

Date filters in the report

lopezeal_4-1638289314161.png

I think the problem is that the "usage" of the part is not being calculated correctly for the specified period but always takes the "total usage", although it is calculating the correct number of failed parts in that time.

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

Could you please provide some sample data of table Warranty and Usage (exclude sensitive data) and list some special examples with incorrect value to explain it with calculation logic and related screenshot? By the way, the applied field on that two date slicers from the table Warranty and Usage? It is better if you can share a simple sample pbix file with me in order to make troubleshooting and provide you a suitable solution. Thank you.

Best Regards

Anonymous
Not applicable

i sent you a private message with my data

Anonymous
Not applicable

Hi @Anonymous ,

I’m sorry to tell you that we could only offer technical support on the Power BI Community for security reason. You can refer the following link to share the file with me.  Also, you can paste your data with Text format directy in your post just like below table. Please exclude the sensitive data before share it with me. Thank you.

How to upload PBI in Community

Col1 Col2 Col3
xx xx xx
xx xx xx

Best Regards

Anonymous
Not applicable

Hi @Anonymous ,

After looking at your pbit file, it turns out that you have two date slicers set up in your report and they come from the same table (Warranty table) in the Created On and MFG. on fields. The field that connects the Usage and Warranty tables is party#, thus when using the date slicer, it will filter out the part# that filters the corresponding date period, and the Usage table will only come up with the corresponding part# info. I checked the data and found that usage also shows the Usage value of the filtered part#, but not total usage values. Also, I found a date field in the table Usage, do you want its data to be displayed according to the selected date range?

yingyinr_0-1640771148072.png

yingyinr_1-1640771265611.png

 

Best Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors