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
Anonymous
Not applicable

Distinct Count for items listed planned but date column shows are Overdue

Hi All,

 

I have been using PowerBi for a little while now and am familiar eith the basic functions - however I am funding it difficult to create the following.

 

I am looking to create a distinct count of items listed as 'planned' in the 'Interaction column' but have past there 'date of interaction' date:

Ankap_0-1594256425781.png

Any help as to a dax forumula to enter into a custom column measure would be appreciated!

 

Regards

5 REPLIES 5
mwaltercpa
Advocate III
Advocate III

This DAX measure should allow  you to create a numeric flag for each item, using a 1 for overdue planned events. All other events will remain, but show a 0 in the column. The total in this example sums to 5 overdue planned events prior to todays date 7/8. 

 

mwaltercpa_0-1594275787686.png

 

 

OverdueInteraction =
 
VAR __t = ADDCOLUMNS(
SUMMARIZE(
FactTable,
DateTable[Date],
FactTable[Interaction Status]
),
"CTROW",
IF(AND(FactTable[Interaction Status]="Planned", DateTable[Date]<TODAY()),1,0)
)
return
SUMX(__t,[CTROW])

It appears you are trying to calculate this as a column rather than a measure. 

I'll also note, that when you create the measure, you'll want to adjust the table name (mine was FactSales) to show your table name that holds the events. 

 

If you are looking for a calcultaed column that counts all the overdue events regardless of current row, that is possible too, just let me know. 

 

Thanks, 
Mark

Anonymous
Not applicable

Hi Thanks for your responce 🙂

 

when entering I am not allowed to proceed due to a 'Token EOF expected':

Ankap_0-1594277277420.png

 

I am entering the formula as follows:

 

VAR __t = ADDCOLUMNS(
SUMMARIZE(
FactTable,
[Date Of Interaction],
[Interaction Status]
),
"CTROW",
IF(AND([Interaction Status]="Planned", [Date Of Interaction]<TODAY()),1,0)
)
return
SUMX(__t,[CTROW])

@mwaltercpa 

Anonymous
Not applicable

Hi @Anonymous 
Have you tried this formula:


CALCULATE ( DISTINCTCOUNT ( table1[Items ID] ) , table1[Interaction Status] = "Planned" , FILTER ( table1 , TODAY() > table1[Date of Interaction]) ) )

Anonymous
Not applicable

Hi @Anonymous 

 

When I tried that it is giving me the value '4' for all fields:

Ankap_0-1594259973660.png

 

Could this be because non of the enteries are currently overdue?
I guess I am after the a '0' being put in the place of the enteries not being overdue and a '1' being in place where the entries are overdue..

Thanks!

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.