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

View all the Fabric Data Days sessions on demand. View schedule

Reply
HillUser1
Frequent Visitor

DAX Help: How to iterate a calculation over a single dataset based on a time period.

I am struggling to understand how I could perofrm this calculation within PowerBI/DAX.

 

Calculation: Create a weighted rating system to help our company rank customers. Our team has come up with a set of criteras to rate each cusotmer by. They have created a rating system to be based a time period of (1) year. If the customer has been with us for greater then (1) year then they want the calculation to be performed for each year then averaged.

 
 

Capture.PNG

Issue: I do not undestand how to perform the calculation when each customer does not exist for the same time period. How can I loop over a single table of customer table and dynmaically perform the calculcation and filter a single data set to perform the calculation. In my head it would require a For Each or While Statement, but so far in my DAX experince I have not seen a function like this.

 

Any help pointing me to other examples or a response saying this is outside DAX's fucntionaly would be helpfull. 

1 ACCEPTED SOLUTION
HillUser1
Frequent Visitor

+ Update:

 

I will perform the required math outside of PowerBI (WinForm/VB.net) and write the calcuated values to a database.

View solution in original post

3 REPLIES 3
HillUser1
Frequent Visitor

+ Update:

 

I will perform the required math outside of PowerBI (WinForm/VB.net) and write the calcuated values to a database.

amitchandak
Super User
Super User

@HillUser1 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I can not post a sample dataset becuase I dont know all the senstive fields and this PBIX combines multiple tables together. I created a sample table showing the calculation, but the issue is that sum for all the years or manually requires me to filter the table with a slicer.

 

Data Tables:

    Invoice Table (All invoices to sum total revenue)

    Work Order Table (All Quotes, Counts,

    Customer Table (Customer Name, ID, Address, Date Entered)

    

 

HillUser1_0-1610983522845.png

 

Sample Concept Table for Calculation

 

HillUser1_1-1610985588611.png

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors