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
Diodio26
New Member

Calculating duplicated values on the same column

Hello. I´ve been trying to do the following but haven´t been able to. I would appreciate any help.

 

ProjectMemberValueValue 2
ALaura301
ALaura302
AGeorge404
BPeter205
CPeter209
CGeorge1011

 

I would like for project A, to obtain 30+40 = 70. Instead of getting 30+30+40.

 

Value 2 was obtained with a merge query and that caused some rows to duplicate.

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Diodio26 ,

Based on your description, you can create a calculated column like this:

_Value =
VAR tab =
    SUMMARIZE ( 'Table', 'Table'[Project], 'Table'[Member], 'Table'[Value] )
RETURN
    SUMX ( FILTER ( tab, [Project] = EARLIER ( 'Table'[Project] ) ), [Value] )

value.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @Diodio26 ,

Based on your description, you can create a calculated column like this:

_Value =
VAR tab =
    SUMMARIZE ( 'Table', 'Table'[Project], 'Table'[Member], 'Table'[Value] )
RETURN
    SUMX ( FILTER ( tab, [Project] = EARLIER ( 'Table'[Project] ) ), [Value] )

value.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

I wrote these measures

Total = min(Data[Value])
Measure = SUMX(SUMMARIZE(Data,Data[Project],Data[Member],"ABCD",[Total]),[ABCD])

To your visual, drag Project and Measure.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Employee
Employee

You should further modify your query to remove those duplicate rows if you don't need them.  In any case, here is a measure that should get your desired result.

 

NewMeasure =
VAR vSummary =
    SUMMARIZE (
        Projects,
        Projects[Project],
        Projects[Member],
        "cAvg"AVERAGE ( Projects[Value] )
    )
RETURN
    SUMX (
        vSummary,
        [cAvg]
    )

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.