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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

This worked, thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.