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
TEACHY888
Regular Visitor

Amount of New IDs / Customers which are created / generated After the Start Date of a Date Range.

Hi All, It would be great if someone could help me. I need show the amount of new Ids which are generated / created after the StartDate of a selected date Range. so far I have done this but its not working : 

 

VAR StartDate = SELECTEDVALUE(OpportunityOldValue_NewValue[Changed_Date])
VAR EndDate = SELECTEDVALUE(OpportunityOldValue_NewValue[Changed_Date])
VAR MinOpportunitySID = CALCULATE(MIN(OpportunityOldValue_NewValue[Opportunity_SID]), OpportunityOldValue_NewValue[Changed_Date] >= StartDate)
RETURN
    CALCULATE(
        SUM(OpportunityOldValue_NewValue[Amount]),
        DATESBETWEEN(OpportunityOldValue_NewValue[Changed_Date], StartDate, EndDate),
        OpportunityOldValue_NewValue[Opportunity_SID] > MinOpportunitySID
    ) - CALCULATE(
        SUM(OpportunityOldValue_NewValue[Amount]),
        FILTER(
            OpportunityOldValue_NewValue,
            OpportunityOldValue_NewValue[Changed_Date] = StartDate
        )
    )

 

Any help would be really appriiciated , thanks in advance. 

 

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @TEACHY888 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1683184782644.png

Please try:

 

Measure = 
var _a = MINX(ALLSELECTED(OpportunityOldValue_NewValue[Changed_Date]),[Changed_Date])
var _b = MAXX(ALLSELECTED(OpportunityOldValue_NewValue[Changed_Date]),[Changed_Date])
var _c = SELECTCOLUMNS(FILTER(ALL(OpportunityOldValue_NewValue),[Changed_Date]<_a),"ID",[Opportunity_SID])
var _d = FILTER(ALL(OpportunityOldValue_NewValue),[Changed_Date]>=_a&&[Changed_Date]<=_b&&NOT([Opportunity_SID] in _c))
return SUMX(_d,[Amount])

 

Final output:

vjianbolimsft_1-1683184820560.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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