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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Measure to Sum duplicate Amounts by distinct ID after Merging Parent table to Child table

Hi,

 

I have merged a Salesforce Opportunity object (parent) to a Revenue object (child) where for each Opportunity ID, there will be multiple revenue line items due to revenue realized in installments (multiple period_start & period_end dates).

 

Opportunity_IDUSD_AmountPeriod_StartPeriod_EndRevenueInstallments
100011950015-Nov-1730-Nov-172084541
10001195001-Dec-1731-Dec-17391094.632
10001195001-Jan-1819-Jan-18504513
10001195001-Feb-1828-Feb-18 4
10001195001-Mar-1831-Mar-18 5
10001195001-Apr-1830-Apr-18 6
1000215001-Sep-171-Sep-174261
1000215001-Aug-1731-Aug-1712504.262
10002150028-Jul-1731-Jul-1720703
10003500001-Jan-1931-Jan-19393701
10003500001-Feb-1928-Feb-19393702
10003500001-Mar-191-Mar-1912603
100042300001-Jan-1826-Jan-18416571
1000423000022-Nov-1730-Nov-1799032
100042300001-Dec-1731-Dec-1778439.83

 

I want to create 2 measures:

- Opportunity distinct numbers [ Opp(#) ]

- Opportunity distinct USD_Amount [ Opp($) ]

As you can see, USD_Amount is duplicated for each Opportunity ID due to which the Opportunity $ shows up incorrect results (multiplied). I have the following 2 measures that worked on the parent Opportunity before the Merge, but not working now after the Merge with the child Revenue object. I want to modify these 2 measures to calculate the distinct USD_Amounts based on distinct Opportunity ID's and LastDate of Period_End or LastDate of Period_Start.

 

 

 

 

Opps(#) = CALCULATE(DISTINCTCOUNT('FACT'[Opportunity_ID_18__c]),'FACT'[USD_Amount__c] <= 1000000,USERELATIONSHIP(dimDate[Date],'FACT'[CreatedDate]))
Opp($) = 
CALCULATE( SUM('FACT'[USD_Amount__c]), 'FACT'[USD_Amount__c] <= 1000000, USERELATIONSHIP(dimDate[Date],'FACT'[CreatedDate]))

 

 

 

 

 

How do i incorporate LastDate of Period_End or LastDate of Period_Start in the above measures to sum up the correct USD_Amounts per Opportunity ID?

 

Any help would be most appreciated.

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

How do i incorporate LastDate of Period_End or LastDate of Period_Start in the above measures to sum up the correct USD_Amounts per Opportunity ID?

not very sure, could you add expected result on your data table? and how to calculate it. then I'll write the measure later.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please explain what the rules are for calculating the revenue amount for a timeframe.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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