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

Count how many employees whose salary increased

Hi,

 

 

DateEmp IDSalary
01/01/20221011000
01/01/20221021500
01/01/20221032000
01/02/20221015000
01/02/20221021500
01/02/20221033000

 

As you can see from the table above, Employees 101 and 103 have a salary increase. I'd like a measure for a card visual that counts the number of employees who have a salary increase in comparison to the previous month. In this case, the answer will be just 2.

 

I appreciate your help.

 

Thanks in advance.

1 ACCEPTED SOLUTION
pratyashasamal
Memorable Member
Memorable Member

Hi @Anonymous ,
Please create these measures first ,

Measure Last Month = CALCULATE( [Increase count],PREVIOUSMONTH('Table (3)'[Date]))
Measure1 % difference from Salary =
VAR __BASELINE_VALUE = SUM('Table (3)'[Salary])
VAR __VALUE_TO_COMPARE = CALCULATE( SUM('Table (3)'[Salary]),PREVIOUSMONTH('Table (3)'[Date]))
RETURN
    IF(
        NOT ISBLANK(__VALUE_TO_COMPARE),
        DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
    )
Count Measure = 1
Increase count = If( [Salary % difference from Measure1] > 0 , [Count Measure]+1,0)
Use a KPI visual
Now could add "Increase count" in  value , "Date" in Trend axis and "Measure Last month" in Target.
pratyashasamal_0-1670492378039.png

Thanks ,
Pratyasha 
Please mark this as the solution if this is helpful for you .





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
pratyashasamal
Memorable Member
Memorable Member

Hi @Anonymous ,
Please create these measures first ,

Measure Last Month = CALCULATE( [Increase count],PREVIOUSMONTH('Table (3)'[Date]))
Measure1 % difference from Salary =
VAR __BASELINE_VALUE = SUM('Table (3)'[Salary])
VAR __VALUE_TO_COMPARE = CALCULATE( SUM('Table (3)'[Salary]),PREVIOUSMONTH('Table (3)'[Date]))
RETURN
    IF(
        NOT ISBLANK(__VALUE_TO_COMPARE),
        DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
    )
Count Measure = 1
Increase count = If( [Salary % difference from Measure1] > 0 , [Count Measure]+1,0)
Use a KPI visual
Now could add "Increase count" in  value , "Date" in Trend axis and "Measure Last month" in Target.
pratyashasamal_0-1670492378039.png

Thanks ,
Pratyasha 
Please mark this as the solution if this is helpful for you .





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Hi, appreciate if anyone could help. Thanks

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.