cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper I

## Sum of Distinct columns by Created Previous Month Date

Hello all!

Here's the data I'm trying to calc the previous months (February) data based on these distinct columns:

Thank you!!

1 ACCEPTED SOLUTION
Helper I

Thank you, gave that one a shot but wasn't quite what I was looking for. I'd been working on this seperately with this formula and got to what I needed, not sure if this is efficient?...

New Column =

CALCULATE(

SUMX(

DISTINCT (Table'[ID]), CALCULATE(MAX('Table'[Amount]))),

DATESINPERIOD('Table'[Created Date],MAX('Table'[Created Date]),-30,DAY))

3 REPLIES 3
Super User

Hi @lw24

NewColumn =
VAR T1 =
CALCULATETABLE (
'Table',
ALLEXCEPT (
'Table',
'Table'[File Date],
'Table'[Name],
'Table'[ID],
'Table'[Created Date]
)
)
VAR T2 =
FILTER (
T1,
FORMAT ( 'Table'[File Date], "YYMM" ) = FORMAT ( 'Table'[Created Date], "YYMM" )
)
RETURN
MAXX ( T, 'Table'[Amount] ) + 0

Helper I

Thank you, gave that one a shot but wasn't quite what I was looking for. I'd been working on this seperately with this formula and got to what I needed, not sure if this is efficient?...

New Column =

CALCULATE(

SUMX(

DISTINCT (Table'[ID]), CALCULATE(MAX('Table'[Amount]))),

DATESINPERIOD('Table'[Created Date],MAX('Table'[Created Date]),-30,DAY))

Super User

hi @lw24

the logic is not very clear. could you elaborate it?

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors