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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
pmstahl
Frequent Visitor

Add to Count Based on Conditions

To provide context to my issue: The goal of the data provided is to track sales through their life cycle filtered by lead source (Facebook, Referral, Yard Sign, etc.)

We have refined our investigation to four key status points:

Door Knock Count: How many doors did our sales team knock?

Set Appt Count: How many appointments did our sales team make after talking to home owners?

SAO Count: How many signed deals did the appointments generate?

JTIs with SAOs: How many SAOs actually became Jobs Turned In 

 

We pulled data from our Sales Rep's App and gathered this information. There is a problem: There are more SAO and JTI than Appts. If a job has a JTI, it should have an Appt that led to that JTI. Our sales reps were not using the app correctly and missing status updates.sr1.PNG

 

To identify the issue I drilled down into the numbers and found that 5 sales reps used the apps incorrectly. As you can see in rows 1-4 and row 7, the door knock count and set appt count are blank but should be showing a value of 1 (I went to the app and verified that those steps were skipped all together and thus not in the source data). 

sr2.PNG

 

The DAX to calculate the various columns looks like this:

sr3.png

What I need is for the Set Appt Count to display a 1 if the JTI count is 1. I took a stab at this but am a beginning PowerBI user (I am in my 2nd week):

sr4.PNG

My thought process: If the JTI is > 0 and the Set Appt Count is blank, then just copy the JTI number, otherwise, run the calculation for Set Appt Count as normal.  I got what I wanted at a granular level:

sr5.PNG

In the new Appt Count If Blank column I have a "1" for each row that has a JTI and the correct Appt Count if the JTI is blank. However, in the total row it still only shows 3 below the Appt Count If Blank instead of 8.  When I remove the Sales Rep Name (mostly hidden for confidentiality), I lose the granularity and my Door Knock, Appt Count If Blank, SAO Count, and JTI read 5, 3, 7, 6 instead of 5, 8, 7, 6. 

 

My two questions are:

1. Why is my DAX equation recognized and accurate on the granular level of Sales Rep but the total row is incorrect? 

2.  Is there any way to write a calculation that provided my desired output filtered across multiple granular levels (by month, fiscal week, lead source, drilled all the way down to sales rep, etc.)? 

 

 

 

 

0 REPLIES 0

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.