The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I would like a formula that will calculate the count of new billed clients looking at the previously 12-months history of billed clients. Client 3 shows an example of a new client that wasn't billed before so the total count of all clients should be 1. The other clients, when looking at the latest column (December), that have a 1 in the December column look like they have been billed at least more than once in the previous 12 months so these should not be included in the calculation. I am looking for a formula that would use the current month as the month to use to compare to the previous 12 months.
Solved! Go to Solution.
Hi,
One of ways to solve this is, try to use EXCEPT DAX function in a measure.
EXCEPT function (DAX) - DAX | Microsoft Learn
Please try writing a measure something like similar to below.
new customer list count in current month measure: =
VAR _currentmonthcustomerlist =
DISTINCT ( Customer[Customer] )
VAR _prevelevenmonthscustomerlist =
CALCULATETABLE (
DISTINCT ( Customer[Customer] ),
DATESBETWEEN (
Calendar[Date],
EOMONTH ( MAX ( Calendar[Date] ), -12 ) + 1,
EOMONTH ( MAX ( Calendar[Date] ), -1 )
)
)
RETURN
COUNTROWS (
EXCEPT ( _currentmonthcustomerlist, _prevelevenmonthscustomerlist )
)
Hi,
One of ways to solve this is, try to use EXCEPT DAX function in a measure.
EXCEPT function (DAX) - DAX | Microsoft Learn
Please try writing a measure something like similar to below.
new customer list count in current month measure: =
VAR _currentmonthcustomerlist =
DISTINCT ( Customer[Customer] )
VAR _prevelevenmonthscustomerlist =
CALCULATETABLE (
DISTINCT ( Customer[Customer] ),
DATESBETWEEN (
Calendar[Date],
EOMONTH ( MAX ( Calendar[Date] ), -12 ) + 1,
EOMONTH ( MAX ( Calendar[Date] ), -1 )
)
)
RETURN
COUNTROWS (
EXCEPT ( _currentmonthcustomerlist, _prevelevenmonthscustomerlist )
)
This worked, thank you!
User | Count |
---|---|
16 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |