# Group by when using calculated date in measure

Hi
I have a measure [Payment Date] that is calculated based on a number of working days from the processing date. This all seems to work fine.

At the moment this give me multiple lines per group but I want to total tGroup by Group using calculated measure.pbix (144.5 KB) he values in this table by Group - in the above example it would be
5004 6216
5007 122
5009 65
5017 15.24
5027 5
5030 0

How can I do this when the table created above relies on the processing date being the selected value to calculate the payment date. The above table is filtered on payment

Iâ€™ve attached my pbix file

See if this hits the mark for you:

Total Value by Group =

``````VAR TotValbyGp =
CALCULATE(
[Total Value],
ALLEXCEPT(
Data,
Data[Group]
)
)

RETURN
IF( HASONEVALUE( Data[Group] ), TotValbyGp, [Total Value])
``````

I hope this is helpful. Full solution file attached.

P.S. Might be clearer to show this as a matrix - works either way:

1 Like

@AliB Hey Mate ,
You can try this way .

Try This dax
Group Table = SUMMARIZE(Data,

Data[Group],

Data[Processing Date],

â€śTotal Valueâ€ť, SUM(Data[GoodValue]))

Cheers

Hi @AliB
I found a video that Sam did which explains SUMMARIZE formula.
I thought this might help.

Cheers
Michael

1 Like

Thank you Brian - just the job

Thanks but I couldnâ€™t see how this would work when payment date doesnâ€™t exist in the table