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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! 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
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.