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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
nidhs909
Frequent Visitor

Bonus Calculation

Hello!

 

I have achieved below result using a matrix. 

 

nidhs909_0-1720084009142.png

Above table, where bonus rate is 1.0, can be 1.5 or 2 also depending on some conditions. 

 

Now, what I would like to achieve is, 

 

1. Number of 1's from the first 7 occurences of jobs. 

2. Number of 1's from the 8th to 12th occurences of jobs. 

3. Number of 1's from the 13th and above occurences of jobs. 

 

Please help me how to solve this. 

 

Many thanks in advance.  

2 REPLIES 2
Alican_C
Resolver II
Resolver II

You can use DAX to create calculated column and measures that count the occurrences of the bonus rates based on your specified conditions. 
You need to create a calculated column that ranks the occurrences of jobs for each employee:


OccurrenceRank =
VAR Employee = [EmpID]
VAR Date = [Date]
RETURN
RANKX(
FILTER(
'Table',
'Table'[EmpID] = Employee
),
[Date],
,
ASC,
DENSE
)

This column will assign a rank to each job occurrence for every employee based on the date.
---
Next, create measures to count the number of 1 based on the specified occurrence ranges:

Count1s_First7 =
CALCULATE(
COUNTROWS('Table'),
'Table'[Bonus Rate] = 1,
'Table'[OccurrenceRank] <= 7
)

Count1s_8thTo12th =
CALCULATE(
COUNTROWS('Table'),
'Table'[Bonus Rate] = 1,
'Table'[OccurrenceRank] > 7,
'Table'[OccurrenceRank] <= 12
)

Count1s_13thAndAbove =
CALCULATE(
COUNTROWS('Table'),
'Table'[Bonus Rate] = 1,
'Table'[OccurrenceRank] > 12
)
These measures will count the number of 1s in the specified occurence ranges.

Thank you for the prompt response. 

 

How will the Rank work with the slicer on date?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.