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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

get sum of values considering one value in case of duplicate records

Hi All,

 

I have my factless fact tablle like below, which explains that I have three objects Tags,engg_doc and Issues each of them can be related one to many (eg. a tag can have many documents related, issues can have many Docs related to one). I need to sum the earned value of the documents that are related to issues but I should consider only one value in case of duplicates. eg. from the below tables the highlighted documents in green color and their earned values shall be considered in the summation while the red ones shall not be considered as they are duplicates. 

 

Fact table:

Tag_NameEngg_Doc_NameIssue_Name
T-101Doc-101 
T-101Doc-102 
T-101Doc-103 
T-101Doc-104 
T-101Doc-105 
T-101 I-100
T-101 I-101
T-101 I-102
T-101 I-103
T-101 I-104
T-102Doc-104 
T-102Doc-105 
T-102Doc-106 
T-102Doc-107 
T-103Doc-101 
T-103Doc-102 
T-103Doc-103 
T-103Doc-104 
T-103Doc-105 
T-103Doc-106 
T-103Doc-107 
T-103Doc-108 
T-103Doc-109 
 Doc-104I-105
 Doc-105I-105
 Doc-106I-105
 Doc-107I-105
 Doc-108I-105
 Doc-109I-105
 Doc-110I-105
 Doc-111I-105
 Doc-109I-106
 Doc-110I-106
 Doc-111I-106
 Doc-104I-106
 Doc-105I-106
 Doc-106I-106
 Doc-112I-107
 Doc-113I-107
 Doc-114I-107
 Doc-115I-107
 Doc-116I-107

 

 

Doc_issue.JPG

 

my document dimension table looks like this.

 

NameTypeRevisionSub FunctionDisciplineDocTypeDisciplineEarned ValueTotal Mnhrs
Doc-101Engineering DocumentAMechanicalP&IDMechanical80100
Doc-102Engineering DocumentBElectricalP&IDElectrical2775
Doc-103Engineering DocumentBInstrumentationP&IDInstrumentation5765
Doc-104Engineering DocumentBPipingP&IDPiping2281
Doc-105Engineering DocumentBPipingP&IDPiping7991
Doc-106Engineering DocumentBPipingP&IDPiping99101
Doc-107Engineering DocumentBPipingP&IDPiping123231
Doc-108Engineering DocumentBPipingP&IDPiping143156
Doc-109Engineering DocumentBPipingP&IDPiping112112
Doc-110Engineering DocumentBElectricalDSElectrical2790
Doc-111Engineering DocumentBInstrumentationDSInstrumentation2289
Doc-112Engineering DocumentBInstrumentationDSInstrumentation2289
Doc-113Engineering DocumentBInstrumentationDSInstrumentation2289
Doc-114Engineering DocumentBInstrumentationDSInstrumentation2289
Doc-115Engineering DocumentBInstrumentationDSInstrumentation2289
Doc-116Engineering DocumentBInstrumentationDSInstrumentation2289

 

I have tried something like below and its not excluding the duplicates can anyone help me with this?

 

Distinct sum Measure = CALCULATE(SUM('Fact'[deficit lookup]),'Fact'[Issue_Name]<> BLANK(),'Fact'[Idocs_Engg_Doc_Name]<>BLANK(),DISTINCT('Fact'[Idocs_Engg_Doc_Name]))

 

regards,

CK

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I was able to achieve it using the below snippet

 

Deficit EV = CALCULATE(SUMX(DISTINCT('Fact'[Idocs_Engg_Doc_Name]),FIRSTNONBLANK('Fact'[deficit lookup],0)),'Fact'[Issue_Name]<>BLANK(),'Fact'[Idocs_Engg_Doc_Name]<>BLANK())
 
regards,
CK

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I was able to achieve it using the below snippet

 

Deficit EV = CALCULATE(SUMX(DISTINCT('Fact'[Idocs_Engg_Doc_Name]),FIRSTNONBLANK('Fact'[deficit lookup],0)),'Fact'[Issue_Name]<>BLANK(),'Fact'[Idocs_Engg_Doc_Name]<>BLANK())
 
regards,
CK

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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