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
datatbl123
Helper I
Helper I

Sum of a value showing for the first time in the last 12 months

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.

 

example.jpg

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

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 )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

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 )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

This worked, thank you!

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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