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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
AllanBerces
Post Prodigy
Post Prodigy

Sum - Calculated Column

Hi good day,

Can anyone help me on my calculated column on how to arrived on my desired outcome.

Current Table

AllanBerces_1-1723367882173.png

 

Desired Outcome adding calculated column

AllanBerces_2-1723367911207.png

 

Thank you

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below (the picture and the attached pbix file).

 

Jihwan_Kim_0-1723368846027.png

 

 

desired outcome CC = 
SUMX (
    FILTER (
        SUMMARIZECOLUMNS (
            data[date],
            data[location],
            data[trade],
            data[week_no],
            data[count]
        ),
        data[date] = EARLIER ( data[date] )
            && data[location] = EARLIER ( data[location] )
    ),
    data[count]
)

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question





View solution in original post

5 REPLIES 5
dvraan
Frequent Visitor

CALCULATE(SUMX(DISTINCT(data[count]), data[count]), ALLEXCEPT(data, data[date], data[location]))

 

But i suggest to use Remove duplicate in power query 

 

CALCULATE(SUM(data[count]), ALLEXCEPT(data, data[date], data[location]))

 

Jihwan_Kim
Super User
Super User

Hi,

Please try something like below (the picture and the attached pbix file).

 

Jihwan_Kim_0-1723368846027.png

 

 

desired outcome CC = 
SUMX (
    FILTER (
        SUMMARIZECOLUMNS (
            data[date],
            data[location],
            data[trade],
            data[week_no],
            data[count]
        ),
        data[date] = EARLIER ( data[date] )
            && data[location] = EARLIER ( data[location] )
    ),
    data[count]
)

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question





CALCULATE(SUMX(DISTINCT(data[count]), data[count]), ALLEXCEPT(data, data[date], data[location]))

 

But I suggest Remove duplicate in power query 

 

CALCULATE(SUM(data[count]), ALLEXCEPT(data, data[date], data[location]))

HI @Jihwan_Kim if you dont mine how can i chage the solution in to Measure.

 

Thank you

Hi @Jihwan_Kim Thank you very much you save my day.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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