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.

image

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

@AliB,

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]) 

image

I hope this is helpful. Full solution file attached.

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

image

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]))

Group by Group using calculated measure.pbix (147.6 KB)

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 :grin:

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