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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
krishb1414
Helper III
Helper III

Sum of values of same date

Hi Everyone,

 

I need to do sum of count column and result will be shown as final column.

If there is any 2 same dates then count column will do sum else returns count column value.

Can anyone help ?

krishb1414_0-1691411796947.png

 

2 ACCEPTED SOLUTIONS
DOLEARY85
Super User
Super User

Hi,

 

try this:

 

Column = CALCULATE(sum('Table'[count]),ALLEXCEPT('Table','Table'[Date]))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

v-stephen-msft
Community Support
Community Support

Hi @krishb1414 ,

 

You could create a calculated column.

final = CALCULATE(SUM('Table'[count]),FILTER('Table',[Date]=EARLIER('Table'[Date])))

vstephenmsft_0-1691549274226.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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-stephen-msft
Community Support
Community Support

Hi @krishb1414 ,

 

You could create a calculated column.

final = CALCULATE(SUM('Table'[count]),FILTER('Table',[Date]=EARLIER('Table'[Date])))

vstephenmsft_0-1691549274226.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

DOLEARY85
Super User
Super User

Hi,

 

try this:

 

Column = CALCULATE(sum('Table'[count]),ALLEXCEPT('Table','Table'[Date]))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
AmiraBedh
Resident Rockstar
Resident Rockstar

Based on your dataset :

 

DateTable =
DATATABLE (
"Date", DATETIME,
"count", DOUBLE,
{
{ "01/08/2023", 0.5 },
{ "01/08/2023", 0.5 },
{ "02/08/2023", 0.5 },
{ "02/08/2023", 0.5 },
{ "03/08/2023", 0.5 },
{ "04/08/2023", 0.5 },
{ "04/08/2023", 0.5 }
}
)

Create a summarized table like below : 

SummarizedTable =
    SUMMARIZE (
        DateTable,
        DateTable[Date],
        "Final", IF(COUNTROWS(DateTable) > 1, SUM(DateTable[count]), MIN(DateTable[count]))
    )

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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