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
krete-datadream
Regular Visitor

Maxx by categroy as a column

I have been searching and trying out for hours. Really simple thing that I need and cannot figure why this is not working.
>>I want to have a DAX formula to have a new column - Person last salary change period. I want to use this column later for measures like average over organization etc.
>> This should be this but somehow this doesn't work

Column=
MAXX (
      SUMMARIZE(Fact_Table, Fact_Table[Employee],"measure",calculate([Max Salary Increase Period])),[measure]
  )
Column - Salary Increase Period=
if(isblank([Salary Increase]),blank(),[Period Key])
Measure - Max Salary Increase Period=max( Salary Increase Period)


ex1.PNG

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@krete-datadream  does this work

 

Column =
CALCULATE (
    CALCULATE (
        MAX ( 'Table'[period] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[increase] <> 0
                && 'Table'[emp] = MAX ( 'Table'[emp] )
        )
    )
)

or

Column=
CALCULATE (
    MAX ( 'Table'[period] ),
    ALLEXCEPT ( 'Table', 'Table'[emp] ),
    'Table'[increase] <> 0
)

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
krete-datadream
Regular Visitor

tried the 2nd one and it worked! So simple it was. 

smpa01
Super User
Super User

@krete-datadream  does this work

 

Column =
CALCULATE (
    CALCULATE (
        MAX ( 'Table'[period] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[increase] <> 0
                && 'Table'[emp] = MAX ( 'Table'[emp] )
        )
    )
)

or

Column=
CALCULATE (
    MAX ( 'Table'[period] ),
    ALLEXCEPT ( 'Table', 'Table'[emp] ),
    'Table'[increase] <> 0
)

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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