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
peternznguyen
Helper II
Helper II

Summerise Amount column with distinct row

Hi experts,

 

I have this Power BI data table Table_Test 

peternznguyen_0-1683632211008.png

I want to summerise column Amount with condition:
If rows have same Date and same Amount, then get one value only to summerise.
For example, when choosing the Date 9/05/2023 it shows 6 and when choosing the date range (by Date Slicer) from 07/05/2023 to 09/05/2023 it shows 20 (6+5+9)
Please help me to write a DAX measure to achieve that

 

I have writtin this measure but it summerised all values of the same date, that is wrong.

Summarized Amount =
SUMX(
DISTINCT(
FILTER(
Table_Test,
Table_Test[Date] >= MIN(Table_Test[Date]) &&
Table_Test[Date] <= MAX(Table_Test[Date])
)
),
Table_Test[Amount]
)

 

Thank you

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

@peternznguyen 
distinct row =
CALCULATE (
SUMX ( VALUES ( 'Table X'[Amount] ), 'Table X'[Amount] ),
ALL ( 'Table X'[Equipment] )
)

Mahesh0016_0-1683634957683.png

@peternznguyen If this post helps, then please consider accepting it as the solution to help other members find it more quickly.THANK YOU!!

View solution in original post

4 REPLIES 4
devanshi
Helper V
Helper V

TotalAmount=

GROUPBY(Table_Name[Date],SUM(Table_Name[Amount]))

Thanks for your solution, but error at

Table_Name[Date]

: "A single value for column 'Date' in table 'Table_Name' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result"

Mahesh0016
Super User
Super User

@peternznguyen 
distinct row =
CALCULATE (
SUMX ( VALUES ( 'Table X'[Amount] ), 'Table X'[Amount] ),
ALL ( 'Table X'[Equipment] )
)

Mahesh0016_0-1683634957683.png

@peternznguyen If this post helps, then please consider accepting it as the solution to help other members find it more quickly.THANK YOU!!

Excellent! thank you very much

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors