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
domtrump
Helper I
Helper I

Grouping Measure counting value only once per group

I have data structured as such:

 

domtrump_0-1711401913580.png

 

An Account can have multiple records in the same category. In such cases, their Revenue will be listed as the same value for each record. I need a MEASURE that will only sum the Revenue value ONE time per Account-Category combination. So in my example, Account 108392299 has two (2) records for the New category. Each record pulls in his revenue of $201.35. My resulting measure SummarizedRevenue, should only count the $201.35 ONE time because it is the same Account-Category combination. How can I construct such a measure?

2 ACCEPTED SOLUTIONS
vicky_
Super User
Super User

If possible, i'd recommend going back to PowerQuery and just removing duplicate rows (unless there's a particular reason you need them?)
Otherwise, try a measure like: 

Amt per Group = 
var tempTable = SUMMARIZE('Table', 'Table'[Account], 'Table'[Catg], 'Table'[Amt])
return SUMX(tempTable, 'Table'[Amt])

View solution in original post

FreemanZ
Super User
Super User

hi @domtrump ,

 

try to plot with a measure like:

Sum = 
SUMX(
    SUMMARIZE(data, data[Account], data[Category], data[Revenue]),
    data[Revenue]
)

 

it worked like:

FreemanZ_0-1711417796006.png

 

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @domtrump ,

 

try to plot with a measure like:

Sum = 
SUMX(
    SUMMARIZE(data, data[Account], data[Category], data[Revenue]),
    data[Revenue]
)

 

it worked like:

FreemanZ_0-1711417796006.png

 

vicky_
Super User
Super User

If possible, i'd recommend going back to PowerQuery and just removing duplicate rows (unless there's a particular reason you need them?)
Otherwise, try a measure like: 

Amt per Group = 
var tempTable = SUMMARIZE('Table', 'Table'[Account], 'Table'[Catg], 'Table'[Amt])
return SUMX(tempTable, 'Table'[Amt])

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.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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