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

How to get customer order wrt item/product except first order

I have created a measure which gives me first order date of the customer with respect to each item or product

komald_0-1649658662471.png

Dax for first order of the customer wrt item/products

FOD_WRT_PRODUCT_CUSTOMER =
MINX(
TOPN(1,New_Product_Item,MIN(New_Product_Item[FactSales.Posting Date]),ASC),New_Product_Item[FactSales.Posting Date])

Now , I wan to find out remaining order of the customer w.r.t item/product except first order , im not able to write dax for the same please help me out. Thanks
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @komald ,

 

Please try the measure and show items when the measure is not blank.

 

Measure = 
VAR FirDate =
    CALCULATE (
        MIN ( New_Product_Item[FactSales.Posting Date] ),
        ALLSELECTED ( New_Product_Item[FactSales.Posting Date] )
    )
RETURN
    COUNTROWS (
        FILTER ( New_Product_Item, New_Product_Item[FactSales.Posting Date] <> FirDate )
    )

vkkfmsft_0-1649903853598.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @komald ,

 

Please try the measure and show items when the measure is not blank.

 

Measure = 
VAR FirDate =
    CALCULATE (
        MIN ( New_Product_Item[FactSales.Posting Date] ),
        ALLSELECTED ( New_Product_Item[FactSales.Posting Date] )
    )
RETURN
    COUNTROWS (
        FILTER ( New_Product_Item, New_Product_Item[FactSales.Posting Date] <> FirDate )
    )

vkkfmsft_0-1649903853598.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @komald 
You may try 

Sales Quantity =
VAR FirstSalesDate = [FOD_WRT_PRODUCT_CUSTOMER]
RETURN
    CALCULATE (
        SUM ( New_Product_Item[FactSales.Quantity] ),
        New_Product_Item[FactSales.Posting Date] <> FirstSalesDate
    )

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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