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
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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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