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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Calculate number of changes month to month

Hello,

 

I have a table like below that shows employee's skills and their proficiency. I report it only for 3 past months so here, number 3 is actual month on which I need to focus.

kosekk_g_0-1657888583224.png

I need to create measures showing how many "skills-ups" I have. So for example if I change from "Begginer" to "Expert" from month 2 to 3 I need something like that: "Begginer -> Expert" - count: 1 . In case of User3 it would be "Expert -> Master" - count: 1. Of course if nothing changes like from month 1 to 2(user kosekk_g), than nothing is reported. I also need to take under consideration that employees come and go so it needs to calculate only when there is a record for past month. 

 

I will appriciate any advice how to accomplish that. 

 

2 ACCEPTED SOLUTIONS
tamerj1
Community Champion
Community Champion

Hi @Anonymous 
Please refer to sample file with the solution https://www.dropbox.com/t/2iLtuoha7iXEEtSw

1.png2.png

skills-ups = 
SUMX (
    Data,
    VAR CurrentNameAndSkilTable = CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Name], Data[Skill] ) )
    VAR CurrentDateIndex = Data[Date_Index]
    VAR CurrentProfRank = RELATED ( Proficiency_Ranks[Rank] )
    VAR PreviousPrfofficiency = MAXX ( FILTER ( CurrentNameAndSkilTable, Data[Date_Index] = CurrentDateIndex - 1 ), Data[Profficiency] )
    VAR PreviousRank = MAXX ( FILTER ( ALL ( Proficiency_Ranks ) , Proficiency_Ranks[Profficiency] = PreviousPrfofficiency ), Proficiency_Ranks[Rank] )
    VAR Result =
        IF (
            PreviousRank <> BLANK ( ) && CurrentProfRank > PreviousRank,
            1,
            0
        )
    RETURN
        Result
)

View solution in original post

tamerj1
Community Champion
Community Champion

Hi @Anonymous 
I believe this should work

skills-ups = 
SUMX (
    Data,
    VAR CurrentNameAndSkilTable = CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Name], Data[Skill] ) )
    VAR CurrentDateIndex = Data[Date_Index]
    VAR CurrentProfRank = RELATED ( Proficiency_Ranks[Rank] )
    VAR PreviousPrfofficiency = MAXX ( FILTER ( CurrentNameAndSkilTable, Data[Date_Index] = CurrentDateIndex - 1 ), Data[Profficiency] )
    VAR PreviousRank = MAXX ( FILTER ( ALL ( Proficiency_Ranks ) , Proficiency_Ranks[Profficiency] = PreviousPrfofficiency ), Proficiency_Ranks[Rank] )
    VAR Result =
        IF (
            PreviousRank <> BLANK ( ) && CurrentProfRank - PreviousRank = 2,
            1,
            0
        )
    RETURN
        Result
)

View solution in original post

5 REPLIES 5
tamerj1
Community Champion
Community Champion

Hi @Anonymous 
I believe this should work

skills-ups = 
SUMX (
    Data,
    VAR CurrentNameAndSkilTable = CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Name], Data[Skill] ) )
    VAR CurrentDateIndex = Data[Date_Index]
    VAR CurrentProfRank = RELATED ( Proficiency_Ranks[Rank] )
    VAR PreviousPrfofficiency = MAXX ( FILTER ( CurrentNameAndSkilTable, Data[Date_Index] = CurrentDateIndex - 1 ), Data[Profficiency] )
    VAR PreviousRank = MAXX ( FILTER ( ALL ( Proficiency_Ranks ) , Proficiency_Ranks[Profficiency] = PreviousPrfofficiency ), Proficiency_Ranks[Rank] )
    VAR Result =
        IF (
            PreviousRank <> BLANK ( ) && CurrentProfRank - PreviousRank = 2,
            1,
            0
        )
    RETURN
        Result
)
Anonymous
Not applicable

Thank you again. Everything works!

Anonymous
Not applicable

@tamerj1 Thank you. That's very helpful!

tamerj1
Community Champion
Community Champion

Hi @Anonymous 
Please refer to sample file with the solution https://www.dropbox.com/t/2iLtuoha7iXEEtSw

1.png2.png

skills-ups = 
SUMX (
    Data,
    VAR CurrentNameAndSkilTable = CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Name], Data[Skill] ) )
    VAR CurrentDateIndex = Data[Date_Index]
    VAR CurrentProfRank = RELATED ( Proficiency_Ranks[Rank] )
    VAR PreviousPrfofficiency = MAXX ( FILTER ( CurrentNameAndSkilTable, Data[Date_Index] = CurrentDateIndex - 1 ), Data[Profficiency] )
    VAR PreviousRank = MAXX ( FILTER ( ALL ( Proficiency_Ranks ) , Proficiency_Ranks[Profficiency] = PreviousPrfofficiency ), Proficiency_Ranks[Rank] )
    VAR Result =
        IF (
            PreviousRank <> BLANK ( ) && CurrentProfRank > PreviousRank,
            1,
            0
        )
    RETURN
        Result
)
Anonymous
Not applicable

Hello again!

 

@tamerj1 I was wondering if this solution could be aligned to count also "skillups" when they increase more than just one step. For example from "Begginer" to "Master" (skipping "Expert"). I've tried to experiment with your code but unfortunately I'm not that good while it comes to DAX.. 

 

Appriciate your help!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.