Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I’m currently developing an arrears report based on the following table. I want to look at the new customers that went into arrears this week. So, I only want to include customer C this week (26/06/2023) because A and B was in arrears last week. How can I do this in a measure?
Customer | Date |
A | 26/06/2023 |
B | 26/06/2023 |
C | 26/06/2023 |
A | 19/06/2023 |
B | 19/06/2023 |
I’m thinking of a measure using Dateadd.
New customers in arrears=
Var CurrentDate = selectedvalue (‘Table’[Date])
Return
Calculate(count(‘table’[Customer]), “check if each company has date = dateadd(CurrentDate, -7, Days)”)
Hi @Anonymous ,
From your sample data and description I assume the following constraints:
Then try the following:
Count of new customers =
VAR _selectedWeek = MAX ( 'Table'[Date] )
VAR _previousWeek = _selectedWeek - 7
VAR _customersSelectedWeek =
CALCULATETABLE (
VALUES ( 'Table'[Customer] ),
'Table'[Date] = _selectedWeek
)
VAR _customersPreviousWeek =
CALCULATETABLE (
VALUES ( 'Table'[Customer] ),
'Table'[Date] =_previousWeek
)
VAR _newCustomers = EXCEPT ( _customersSelectedWeek, _customersPreviousWeek )
VAR _countOfNewCustomers = COUNTAX ( _newCustomers, [Customer] )
RETURN
_countOfNewCustomers
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |