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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pparke
Frequent Visitor

Interpret measures

Hi, 

 

New to Power BI and trying to interpret measures that have been created by someone else. Could anyone intrepret these please? 

 

1.

Rolling HC =
VAR MaxIndex = MAX(TURNOVER_Payroll_Calendar[Index])
VAR MinIndex = MaxIndex - 12
VAR Result =
CALCULATE(
    (COUNT('FINAL_TURNOVER_MERGED'[Position ID])/12), FILTER(ALLEXCEPT('FINAL_TURNOVER_MERGED','FINAL_TURNOVER_MAPPING'[Org Unit],'FINAL_TURNOVER_MAPPING'[NDIS Roles],'FINAL_TURNOVER_MAPPING'[Service Area], 'FINAL_TURNOVER_MAPPING'[Location],'MAPPING_OVERVIEW'[Location],'FINAL_TURNOVER_MAPPING'[Position ID]),'FINAL_TURNOVER_MERGED'[Index] <= MaxIndex && 'FINAL_TURNOVER_MERGED'[Index] > MinIndex && 'FINAL_TURNOVER_MERGED'[Source] = "Position"
    )
   )
RETURN
IF(ISBLANK(Result),0,
Result)
 
 
2. 
Rolling Term =
VAR MaxIndex = MAX(TURNOVER_Payroll_Calendar[Index])
VAR MinIndex = MaxIndex - 12
VAR Result =
CALCULATE(
    (COUNT('FINAL_TURNOVER_MERGED'[Position ID])), FILTER(ALLEXCEPT('FINAL_TURNOVER_MERGED','FINAL_TURNOVER_MAPPING'[Org Unit],'FINAL_TURNOVER_MAPPING'[NDIS Roles],'FINAL_TURNOVER_MAPPING'[Service Area], 'FINAL_TURNOVER_MAPPING'[Location],'MAPPING_OVERVIEW'[Location],'FINAL_TURNOVER_MAPPING'[Position ID]),'FINAL_TURNOVER_MERGED'[Index] <= MaxIndex && 'FINAL_TURNOVER_MERGED'[Index] > MinIndex && 'FINAL_TURNOVER_MERGED'[Source] = "Offboard"
    )
   )
RETURN
IF(ISBLANK(Result),0,
Result)
 
 
Thank You!  
1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @pparke ,

 

This is actually a use-case for which tools like ChatGPT can be your friend. I've reviewed the responses to ensure they haven't been hallucinated.

** The following responses were generated by ChatGPT 4o  **

 

Measure 1:

This DAX measure, `Rolling HC`, calculates the rolling average headcount over a 12-month period for specific organizational units, roles, service areas, locations, and positions within a dataset. Here’s a breakdown of what each part does:

1. **Variable Definitions**:
- `MaxIndex`: Finds the maximum value of the `Index` column in the `TURNOVER_Payroll_Calendar` table within the current filter context.
- `MinIndex`: Calculates the minimum index for the 12-month rolling window by subtracting 12 from `MaxIndex`.

2. **Result Calculation**:
- The `CALCULATE` function is used to modify the context in which the data is evaluated.
- `(COUNT('FINAL_TURNOVER_MERGED'[Position ID])/12)`: Counts the number of unique `Position ID` values in the `FINAL_TURNOVER_MERGED` table and divides by 12 to get a monthly average.
- `FILTER(ALLEXCEPT(...))`: Removes any filters from the `FINAL_TURNOVER_MERGED` table except those on specific columns related to organizational structure (`Org Unit`, `NDIS Roles`, `Service Area`, `Location`, and `Position ID`).
- The `FILTER` function restricts the data to rows where the `Index` is within the 12-month window (`<= MaxIndex && > MinIndex`) and the `Source` column is equal to "Position".

3. **Return Value**:
- The `IF` function checks if `Result` is blank.
- If `Result` is blank, it returns 0.
- Otherwise, it returns the calculated `Result`.

In summary, this measure calculates the average monthly headcount over the past 12 months for specified organizational dimensions. If no data is found, it returns 0.

 

Measure 2:

This DAX measure, `Rolling Term`, calculates the rolling total number of terminations (offboarding) over a 12-month period for specific organizational units, roles, service areas, locations, and positions within a dataset. Here's a detailed breakdown:

1. **Variable Definitions**:
- `MaxIndex`: Finds the maximum value of the `Index` column in the `TURNOVER_Payroll_Calendar` table within the current filter context.
- `MinIndex`: Calculates the minimum index for the 12-month rolling window by subtracting 12 from `MaxIndex`.

2. **Result Calculation**:
- The `CALCULATE` function is used to modify the context in which the data is evaluated.
- `(COUNT('FINAL_TURNOVER_MERGED'[Position ID]))`: Counts the number of unique `Position ID` values in the `FINAL_TURNOVER_MERGED` table.
- `FILTER(ALLEXCEPT(...))`: Removes any filters from the `FINAL_TURNOVER_MERGED` table except those on specific columns related to organizational structure (`Org Unit`, `NDIS Roles`, `Service Area`, `Location`, and `Position ID`).
- The `FILTER` function restricts the data to rows where the `Index` is within the 12-month window (`<= MaxIndex && > MinIndex`) and the `Source` column is equal to "Offboard".

3. **Return Value**:
- The `IF` function checks if `Result` is blank.
- If `Result` is blank, it returns 0.
- Otherwise, it returns the calculated `Result`.

In summary, this measure calculates the total number of terminations (offboardings) over the past 12 months for specified organizational dimensions. If no data is found, it returns 0.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

1 REPLY 1
BA_Pete
Super User
Super User

Hi @pparke ,

 

This is actually a use-case for which tools like ChatGPT can be your friend. I've reviewed the responses to ensure they haven't been hallucinated.

** The following responses were generated by ChatGPT 4o  **

 

Measure 1:

This DAX measure, `Rolling HC`, calculates the rolling average headcount over a 12-month period for specific organizational units, roles, service areas, locations, and positions within a dataset. Here’s a breakdown of what each part does:

1. **Variable Definitions**:
- `MaxIndex`: Finds the maximum value of the `Index` column in the `TURNOVER_Payroll_Calendar` table within the current filter context.
- `MinIndex`: Calculates the minimum index for the 12-month rolling window by subtracting 12 from `MaxIndex`.

2. **Result Calculation**:
- The `CALCULATE` function is used to modify the context in which the data is evaluated.
- `(COUNT('FINAL_TURNOVER_MERGED'[Position ID])/12)`: Counts the number of unique `Position ID` values in the `FINAL_TURNOVER_MERGED` table and divides by 12 to get a monthly average.
- `FILTER(ALLEXCEPT(...))`: Removes any filters from the `FINAL_TURNOVER_MERGED` table except those on specific columns related to organizational structure (`Org Unit`, `NDIS Roles`, `Service Area`, `Location`, and `Position ID`).
- The `FILTER` function restricts the data to rows where the `Index` is within the 12-month window (`<= MaxIndex && > MinIndex`) and the `Source` column is equal to "Position".

3. **Return Value**:
- The `IF` function checks if `Result` is blank.
- If `Result` is blank, it returns 0.
- Otherwise, it returns the calculated `Result`.

In summary, this measure calculates the average monthly headcount over the past 12 months for specified organizational dimensions. If no data is found, it returns 0.

 

Measure 2:

This DAX measure, `Rolling Term`, calculates the rolling total number of terminations (offboarding) over a 12-month period for specific organizational units, roles, service areas, locations, and positions within a dataset. Here's a detailed breakdown:

1. **Variable Definitions**:
- `MaxIndex`: Finds the maximum value of the `Index` column in the `TURNOVER_Payroll_Calendar` table within the current filter context.
- `MinIndex`: Calculates the minimum index for the 12-month rolling window by subtracting 12 from `MaxIndex`.

2. **Result Calculation**:
- The `CALCULATE` function is used to modify the context in which the data is evaluated.
- `(COUNT('FINAL_TURNOVER_MERGED'[Position ID]))`: Counts the number of unique `Position ID` values in the `FINAL_TURNOVER_MERGED` table.
- `FILTER(ALLEXCEPT(...))`: Removes any filters from the `FINAL_TURNOVER_MERGED` table except those on specific columns related to organizational structure (`Org Unit`, `NDIS Roles`, `Service Area`, `Location`, and `Position ID`).
- The `FILTER` function restricts the data to rows where the `Index` is within the 12-month window (`<= MaxIndex && > MinIndex`) and the `Source` column is equal to "Offboard".

3. **Return Value**:
- The `IF` function checks if `Result` is blank.
- If `Result` is blank, it returns 0.
- Otherwise, it returns the calculated `Result`.

In summary, this measure calculates the total number of terminations (offboardings) over the past 12 months for specified organizational dimensions. If no data is found, it returns 0.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.