Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi Fabric Community,
I’m working on a Power BI dashboard to track the KPI of Regional Managers (RM) in real-time. The challenge is to dynamically identify RMs who violate company audit principles, Use any measures or DAX to ensuring the process updates automatically when new data arrives.
I need to create a fully automated process that:
✅Identifies which RM did not meet the corporate principles.
✅Highlights which specific principle(s) were violated.
✅Provides an overview of all RM performance without manual filtering.
✅Updates dynamically when new data is added.
How can I achieve this tracking?
I want to rely on Power Query transformations, filtering, DAX as long as i achieve my objective
Would love to hear suggestions or best practices from the community!
Thanks in advance! 😊
Solved! Go to Solution.
Hi @afiqhaziq589 ,
To automate tracking Regional Manager (RM) KPI violations in Power BI, follow these steps. Combine Power Query transformations, DAX measures, and Power BI visuals to achieve the desired functionality.
Prepare and clean your data in Power Query to ensure the data model is ready for analysis.
Month of Audit: Extract the month fromAUDIT _DATE_ID for aggregation.
MonthName = Date.MonthName([AUDIT_DATE_ID])
Outlet Last Audit Date: Use a grouping and sorting method to calculate the last audit date for each
CUSTOMER_NAME.
LastAuditDate = Table.Group(AUDIT_WGLL, {"CUSTOMER_NAME"}, {{"MaxAuditDate", each List.Max([AUDIT_DATE_ID]), type date}})
Months Since Last Audit: Calculate the time gap in months between audits for the same CUSTOMER_NAME.
MonthsSinceLastAudit = Duration.Days(Duration.From(DateTime.LocalNow() - [LastAuditDate])) / 30
Filter out entries withMonthsSinceLastAudit < 3.
Ensure relationships between your tables are properly defined in the model:
AUDIT_WGLL → Time Dimension for time-based calculations.
Define DAX measures to evaluate each corporate principle.
This tracks the total audits performed by each RM.
RM_Audits =
CALCULATE(
COUNTROWS(AUDIT_WGLL),
AUDIT_WGLL[AUDITED_BY_EMP_TYPE] = "Regional Manager"
)
This calculates total audits by all FAs under an RM.
FA_Audits_By_RM =
CALCULATE(
COUNTROWS(AUDIT_WGLL),
AUDIT_WGLL[AUDITED_BY_EMP_TYPE] = "Field Auditor",
AUDIT_WGLL[ASM_ID] = MAX(AUDIT_WGLL[ASM_ID])
)
Identify violations for RMs based on corporate principles.
Principle_Violations =
SWITCH(
TRUE(),
[RM_Audits] < 100 && [FA_Audits_By_RM] < 100, "RM & FA Violations",
[RM_Audits] < 100, "RM Violation",
[FA_Audits_By_RM] < 100, "FA Violation",
"No Violation"
)
Check if any outlet is audited again within 3 months.
RepeatedAuditViolation =
CALCULATE(
COUNTROWS(AUDIT_WGLL),
DATEDIFF(
LASTNONBLANK(AUDIT_WGLL[AUDIT_DATE_ID], 1),
FIRSTNONBLANK(AUDIT_WGLL[AUDIT_DATE_ID], 1),
MONTH
) < 3
)
Use visuals in Power BI to highlight KPI violations.
Conditional Formatting:
KPI Cards:
Bar Chart or Heat Map:
Ensure the dashboard dynamically updates as new data arrives:
Set up alerts for KPI violations using Power BI's subscription feature or integrate with Power Automate to notify stakeholders when a violation occurs.
Please mark this as solution if it helps you. Appreciate Kudos.
Hi @afiqhaziq589 ,
To automate tracking Regional Manager (RM) KPI violations in Power BI, follow these steps. Combine Power Query transformations, DAX measures, and Power BI visuals to achieve the desired functionality.
Prepare and clean your data in Power Query to ensure the data model is ready for analysis.
Month of Audit: Extract the month fromAUDIT _DATE_ID for aggregation.
MonthName = Date.MonthName([AUDIT_DATE_ID])
Outlet Last Audit Date: Use a grouping and sorting method to calculate the last audit date for each
CUSTOMER_NAME.
LastAuditDate = Table.Group(AUDIT_WGLL, {"CUSTOMER_NAME"}, {{"MaxAuditDate", each List.Max([AUDIT_DATE_ID]), type date}})
Months Since Last Audit: Calculate the time gap in months between audits for the same CUSTOMER_NAME.
MonthsSinceLastAudit = Duration.Days(Duration.From(DateTime.LocalNow() - [LastAuditDate])) / 30
Filter out entries withMonthsSinceLastAudit < 3.
Ensure relationships between your tables are properly defined in the model:
AUDIT_WGLL → Time Dimension for time-based calculations.
Define DAX measures to evaluate each corporate principle.
This tracks the total audits performed by each RM.
RM_Audits =
CALCULATE(
COUNTROWS(AUDIT_WGLL),
AUDIT_WGLL[AUDITED_BY_EMP_TYPE] = "Regional Manager"
)
This calculates total audits by all FAs under an RM.
FA_Audits_By_RM =
CALCULATE(
COUNTROWS(AUDIT_WGLL),
AUDIT_WGLL[AUDITED_BY_EMP_TYPE] = "Field Auditor",
AUDIT_WGLL[ASM_ID] = MAX(AUDIT_WGLL[ASM_ID])
)
Identify violations for RMs based on corporate principles.
Principle_Violations =
SWITCH(
TRUE(),
[RM_Audits] < 100 && [FA_Audits_By_RM] < 100, "RM & FA Violations",
[RM_Audits] < 100, "RM Violation",
[FA_Audits_By_RM] < 100, "FA Violation",
"No Violation"
)
Check if any outlet is audited again within 3 months.
RepeatedAuditViolation =
CALCULATE(
COUNTROWS(AUDIT_WGLL),
DATEDIFF(
LASTNONBLANK(AUDIT_WGLL[AUDIT_DATE_ID], 1),
FIRSTNONBLANK(AUDIT_WGLL[AUDIT_DATE_ID], 1),
MONTH
) < 3
)
Use visuals in Power BI to highlight KPI violations.
Conditional Formatting:
KPI Cards:
Bar Chart or Heat Map:
Ensure the dashboard dynamically updates as new data arrives:
Set up alerts for KPI violations using Power BI's subscription feature or integrate with Power Automate to notify stakeholders when a violation occurs.
Please mark this as solution if it helps you. Appreciate Kudos.
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |