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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
vtayle900
Regular Visitor

Cumulative Sums on different dates

Hi Guys,

 

I have a Date Dim table and another table which contains

Date Signed, Date Sold, and a status column with both Accepted and Sold . Both are connected to the Date Dim which has a Year column. The Date Signed is the active relationship

 

I am trying to cumulate by Year based on the two dates. ie one line Signed by year another Sold by Year. 

 

So far i have tried the below for Date Signed and the values are correct.

 

SalesContracct ## = CALCULATE (
DISTINCTCOUNT(New_salescontractSet[New_salescontractId]),USERELATIONSHIP(New_salescontractSet[SignedOn], 'DateDim'[Date]),
FILTER (ALL(DateDim[Date]),
('DateDim'[Date]) <= MAX ( DateDim[Date] ) && DateDim[Date] <= TODAY()))

 

How do i get the cumulative count if the Sold date is not the active relationship and also inlcude the Status of "Sold"

 

can anyone please assist?

 

cheers

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vtayle900,

You can use the USERELATIONSHIP function to apply an inactive relationship to a particular DAX expression. In your scenario, you are able to use USERELATIONSHIP(New_salescontractSet[SoldOn], 'DateDim'[Date]) formula as a filter, and add another filter which includes “Sold” status in Calculate function.

Please check if the following formula meets your requirement. If not, please share sample data of your tables and post expected result here. Also please help to post detailed error message if you get any errors.

SalesContracctSold ## = CALCULATE (
DISTINCTCOUNT(New_salescontractSet[New_salescontractId]),USERELATIONSHIP(New_salescontractSet[SoldOn], 'DateDim'[Date]),
FILTER (ALL(DateDim[Date]),
('DateDim'[Date]) <= MAX ( DateDim[Date] ) && DateDim[Date] <= TODAY()),New_salescontractSet[Status]="Sold")



Thanks,
Lydia Zhang

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @vtayle900,

You can use the USERELATIONSHIP function to apply an inactive relationship to a particular DAX expression. In your scenario, you are able to use USERELATIONSHIP(New_salescontractSet[SoldOn], 'DateDim'[Date]) formula as a filter, and add another filter which includes “Sold” status in Calculate function.

Please check if the following formula meets your requirement. If not, please share sample data of your tables and post expected result here. Also please help to post detailed error message if you get any errors.

SalesContracctSold ## = CALCULATE (
DISTINCTCOUNT(New_salescontractSet[New_salescontractId]),USERELATIONSHIP(New_salescontractSet[SoldOn], 'DateDim'[Date]),
FILTER (ALL(DateDim[Date]),
('DateDim'[Date]) <= MAX ( DateDim[Date] ) && DateDim[Date] <= TODAY()),New_salescontractSet[Status]="Sold")



Thanks,
Lydia Zhang

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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