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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SachinNamdeo-20
Helper II
Helper II

New coustmer count

"Firstly i explain about my data i have data till 2016 to today 
table -cube target
  this is my data table here sold to partner code is dealer and invoice quantity is sale my date start from 2016 so i mention it everywhere."Screenshot (44).png


        i want to create a measure that  calculate new dealer count that if i select november month of 22 then the created measure check all my data table and give me only count of those dealer that was not present in  my table from 2016 to oct month it means it only return the new dealer count which was not present in all previous month as similar 
when i select oct month of 22 it returns that new coustmer count that was not present in all data from 2016 to sep 2022 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

The below measure assumes that there is a relationship from your calendar table to the fact table

Num new dealers =
VAR EndDate =
    EOMONTH ( MAX ( 'Calendar'[Date] ), -1 )
VAR PrevDealers =
    CALCULATETABLE (
        VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] ),
        REMOVEFILTERS ( 'Calendar' ),
        'Calendar'[Date] <= EndDate
    )
VAR CurrentDealers =
    VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] )
RETURN
    COUNTROWS ( EXCEPT ( CurrentDealers, PrevDealers ) )

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

The below measure assumes that there is a relationship from your calendar table to the fact table

Num new dealers =
VAR EndDate =
    EOMONTH ( MAX ( 'Calendar'[Date] ), -1 )
VAR PrevDealers =
    CALCULATETABLE (
        VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] ),
        REMOVEFILTERS ( 'Calendar' ),
        'Calendar'[Date] <= EndDate
    )
VAR CurrentDealers =
    VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] )
RETURN
    COUNTROWS ( EXCEPT ( CurrentDealers, PrevDealers ) )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.