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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


This worked, thank you!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.