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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AllanBerces
Post Patron
Post Patron

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]
)

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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]
)

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.