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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SamK428113
Frequent Visitor

Calculate avg date difference in network days only for companies with start and end dates.

I am trying to calculate the average of network days for non blanks between Start and End dates. However, when I try to get the average number of networkdays in a given column, the value returns as blank.  Below are the measures I'm using.

 

Test 10 =
VAR _a =
    CALCULATE(
        MIN('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TIME_STAMP]),
        FILTER(ALL('CWMT_MS_QUOTINGREQUESTTRACKER - Master'),
        [COMPANYNAME] = SELECTEDVALUE('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[COMPANYNAME])
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKNAME] = "110 - Attach NPS Packets to Quotes"
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKSTATUS] = "Assigned"))
Var _b =
    CALCULATE(
        MAX('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TIME_STAMP]),
        FILTER(ALL('CWMT_MS_QUOTINGREQUESTTRACKER - Master'),
        [COMPANYNAME] = SELECTEDVALUE('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[COMPANYNAME])
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKNAME] = "510 - Generate Customer Package"
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKSTATUS] = "Completed"))
RETURN
     if (
    ISBLANK([Test 110 Assigned])||ISBLANK([Test 510 Completed]),
    BLANK(),
    NETWORKDAYS([Test 110 Assigned],[Test 510 Completed]))
 
Test 4 = AVERAGEX('CWMT_MS_QUOTINGREQUESTTRACKER - Master', [Test 10])
 
Test 4 returns as (Blank).
 
SamK428113_0-1685039789194.png

 

 

Any idea why the value is showing blank?

 

For calendar days, I'm using this measure and it seems to be working...

 

Test 9 =
VAR _a =
    CALCULATE(
        MIN('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TIME_STAMP]),
        FILTER(ALL('CWMT_MS_QUOTINGREQUESTTRACKER - Master'),
        [COMPANYNAME] = SELECTEDVALUE('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[COMPANYNAME])
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKNAME] = "110 - Attach NPS Packets to Quotes"
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKSTATUS] = "Assigned"))
Var _b =
    CALCULATE(
        MAX('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TIME_STAMP]),
        FILTER(ALL('CWMT_MS_QUOTINGREQUESTTRACKER - Master'),
        [COMPANYNAME] = SELECTEDVALUE('CWMT_MS_QUOTINGREQUESTTRACKER - Master'[COMPANYNAME])
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKNAME] = "510 - Generate Customer Package"
        && 'CWMT_MS_QUOTINGREQUESTTRACKER - Master'[TASKSTATUS] = "Completed"))
Var _c =
    IF (_b > _a_b)
RETURN
    DATEDIFF(_a_cDAY)
 
Test 3 = AVERAGEX('CWMT_MS_QUOTINGREQUESTTRACKER - Master', [Test 9])
 
SamK428113_1-1685039789225.png

 

 

Please advise! Thanks in advance. 

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.