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

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

Reply
avtandylru
Frequent Visitor

Calculate SUM of dax measures

Hu guys. I need to calculate sum of previous calculated measure.

Client  DaysInPeriod(measure)
 1        10
 2        25
 3        30
Total     30

Need

Client   DaysInPerdiod    Total
 1           10             65
 2           25             65
 3           30             65
Total        30             65

 

I' ve tried something like 

Measure 2 = var DaysInPeriod = CALCULATE(DATEDIFF(CALCULATE(MIN(OvPortfolio[daydate_fuib]);ALLSELECTED('Calendar'[daydate_fuib]));CALCULATE(MAX(OvPortfolio[daydate_fuib]);ALLSELECTED('Calendar'[daydate_fuib]));DAY);ALLEXCEPT(OvPortfolio;OvPortfolio[clientid]))
return CALCULATE([DaysInPeriod];ALL(OvPortfolio))
 
But i get
Client   DaysInPerdiod    Total
 1           10             30
 2           25             30
 3           30             30
Total        30             30
 
 
 
1 ACCEPTED SOLUTION
avtandylru
Frequent Visitor

CALCULATE(SUMX(DISTINCT(OvPortfolio[clientid]);CALCULATE(DATEDIFF(CALCULATE(MIN(OvPortfolio[daydate_fuib]);ALLSELECTED('Calendar'[daydate_fuib]));CALCULATE(MAX(OvPortfolio[daydate_fuib]);ALLSELECTED('Calendar'[daydate_fuib]));DAY);ALLEXCEPT(OvPortfolio;OvPortfolio[clientid])));ALLSELECTED(OvPortfolio))

View solution in original post

1 REPLY 1
avtandylru
Frequent Visitor

CALCULATE(SUMX(DISTINCT(OvPortfolio[clientid]);CALCULATE(DATEDIFF(CALCULATE(MIN(OvPortfolio[daydate_fuib]);ALLSELECTED('Calendar'[daydate_fuib]));CALCULATE(MAX(OvPortfolio[daydate_fuib]);ALLSELECTED('Calendar'[daydate_fuib]));DAY);ALLEXCEPT(OvPortfolio;OvPortfolio[clientid])));ALLSELECTED(OvPortfolio))

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.