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! Request now

Reply
CrownWorker
Advocate I
Advocate I

Calculate Product during Support Call

Hello,

 

I have 2 very large tables that bog down SQL when I attempt to create subqueries to calculate which product was in place in our billing system during a call in the support system. I am hoping that DAX can preform this function as a calculated column or measure more efficiently.

 

I have created a mock up of the important fields and left my feeble attempts to calculate this. I know it isnt working because the record you will see on Sunday August 20th 2017 should be the record that is attached to Monday August 21 2017 and instead it is showing thursday August 17th 2017

 

Table.png

Here are the tables I have made up for a mock up

 

Billing Table.pngSupport Table.png

 

This is my feeble attempt at the calculation

 

productmatch.png

Here is another view of the tables being worked with

TableFields.png

2 REPLIES 2
CrownWorker
Advocate I
Advocate I

I relalize that I only put in one service number, of course we have many service numbers and the calculation will need to match the service number then the max date that is less than the support call date and return the product.

Anonymous
Not applicable

@CrownWorker,

Do you make a relationship between the two tables using Index column?

If so, the index 6 in Billing Record table has no related row in Support Record table, thus, when you calculate lastdate column using  CALCULATE(LASTNONBLANK('Billing Record'[Billing Date],1)), you get 8/17/2017 rather than 8/20/2017 for the 8/21/2017 support date,  this is the reason why you don't get expected result in your table visual.
1.PNG

Regards,
Lydia

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