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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AllanBerces
Post Partisan
Post Partisan

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.