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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.