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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Silver75
Frequent Visitor

How can I sum revenue between two date in different table?

Hi all,

I have to sum for each ID the revenue in fact table with date greater than date in dimension 1

The two tables have a secondary relationship.

How can I resolve, please?

Thank you

I have attached an example with target of dax (REVENUE_MEASURE)

 

 

tables.jpg

 

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Silver75,

In your result table, the REVENUE sum should be 70 rather than 20, because 2015/10/10 is also greater than 2015/02/15 for ID 2. I try to reproduce your scenario and get expected result.

For your source table, create a one(FACT) to many(dimension) relationship as the screenshot below, right?

1.PNG

Then create a measure using the formula.

REVENUE_Measure = CALCULATE(SUM('FACT'[REVENUE]),FILTER(ALLEXCEPT('FACT','FACT'[ID]),'FACT'[DATE_ORDER]>RELATED(Dimension1[DATE])))


Finally, create a table visual, select the ID as axis level, the measure as value, you will get result, please see the following screenshot.

2.PNG

If you have any question, please let me know.

Best Regards,
Angelia




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.