Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dkpcr5
Helper II
Helper II

Struggling with a Group By and Max Calculation

I feel like I'm missing something obvious.

I'd like to retrieve the "ISSUE_KEY" field where the "Business Signoff" field matches the person identified in the "CURRENT_ASSIGNEE_NAME" field, shown below as "Desired result":

Picture1.png

Here's my current DAX for this calculated column:

Business Signoff v3 =
IF(
    NOT(ISBLANK(Issues[Business Signoff])),
CALCULATE(
    MAX(Issues[ISSUE_KEY]),
    FILTER(Issues,
    Issues[PROJECT_KEY] = "CHM"
    && Issues[FixVersion] = EARLIER(Issues[FixVersion])
))
)

As you can see, this is all happening within a single table. But I'm struggling to get the grouping right. 

I've tried adding Issues[Business Signoff] = EARLIER(Issues[Business Signoff]) and same with CURRENT_ASSIGNEE_NAME, but was unsuccessful on both fronts.

Could just be that it's late and I've been staring at this for hours. But if someone's able to call this one out, it'd be hugely helpful. Thanks!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @dkpcr5 
Please try

Business Signoff v3 =
VAR BusinessSignoff = Issues[Business Signoff]
VAR CurrentVerionTable =
    CALCULATETABLE ( Issues, ALLEXCEPT ( Issues, Issues[FixVersion] ) )
VAR FilteredTable =
    FILTER (
        CurrentVerionTable,
        Issues[PROJECT_KEY] = "CHM"
            && Issues[CURRENT_ASSIGNEE_NAME] = BusinessSignoff
    )
RETURN
    IF (
        NOT ISBLANK ( Issues[Business Signoff] ),
        MAXX ( FilteredTable, Issues[ISSUE_KEY] )
    )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @dkpcr5 
Please try

Business Signoff v3 =
VAR BusinessSignoff = Issues[Business Signoff]
VAR CurrentVerionTable =
    CALCULATETABLE ( Issues, ALLEXCEPT ( Issues, Issues[FixVersion] ) )
VAR FilteredTable =
    FILTER (
        CurrentVerionTable,
        Issues[PROJECT_KEY] = "CHM"
            && Issues[CURRENT_ASSIGNEE_NAME] = BusinessSignoff
    )
RETURN
    IF (
        NOT ISBLANK ( Issues[Business Signoff] ),
        MAXX ( FilteredTable, Issues[ISSUE_KEY] )
    )

This did it - thanks again @tamerj1 - you're a rockstar

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors