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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
LorenzoC
Regular Visitor

Measure won't work...

Dear All,

i have the following dataset:

IdDateS_CostD_CostTot_D_Cost
101/01/202450015003300
101/01/202450018003300
103/01/2024200025002500
201/02/202450021003300
202/02/202450028003300
210/02/2024200042002500

 

How can I find the sum of distinct value of S_Cost considering there is only one S_Cost for each Id and Date?

My desired result is:

IdDateS_CostD_CostTot_D_CostDesired result
101/01/2024500150033002500
101/01/2024500180033002500
103/01/20242000250025002500
201/02/2024500210021003000
202/02/2024500280028003000
210/02/20242000420042003000

 

Thank you

lorenzo

1 ACCEPTED SOLUTION
Daniel29195
Super User
Super User

@LorenzoC 

output ; 

Daniel29195_0-1718611211713.png

 

try the following calculated column : 

Column =
var ds =
CALCULATEtable(
    SUMMARIZE('Table','Table'[S_Cost],'Table'[Date]) ,
    ALLEXCEPT('Table','Table'[Id])
)

RETURN
SUMX(
    ds,
    [S_Cost]
)



 
let me know if this helps. 

View solution in original post

2 REPLIES 2
Daniel29195
Super User
Super User

@LorenzoC 

output ; 

Daniel29195_0-1718611211713.png

 

try the following calculated column : 

Column =
var ds =
CALCULATEtable(
    SUMMARIZE('Table','Table'[S_Cost],'Table'[Date]) ,
    ALLEXCEPT('Table','Table'[Id])
)

RETURN
SUMX(
    ds,
    [S_Cost]
)



 
let me know if this helps. 

Yeah, it does work!
Thanks a lot

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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