Forum Discussion

rinaibrhm's avatar
rinaibrhm
New Member
2 years ago
Solved

Time Intelligence for Sales and Customer Problem

I have 4 tables as below.   The Current and Previous tables are used to store different time period selections from two slicers, used for comparison.   For sake of simplicity, lets say :- 'Sales...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi rinaibrhm ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create calculated columns.

    Orders_Previous_Period = COUNTROWS(FILTER('Sales','Sales'[Order_Date] in VALUES('Previous'[Date]) && 'Sales'[UserID]=EARLIER('Customer'[UserID])))
    Orders_Current_Period = COUNTROWS(FILTER('Sales','Sales'[Order_Date] in VALUES('Current'[Date]) && 'Sales'[UserID]=EARLIER('Customer'[UserID])))
    Top_Product = 
    var _a=SUMMARIZE('Sales','Sales'[UserID],'Sales'[Product],"count",COUNT('Sales'[Product]))
    var _b=MAXX(FILTER(_a,[UserID] = EARLIER('Customer'[UserID])),[count])
    var _c=FILTER(_a,[count]=_b && [UserID]=EARLIER('Customer'[UserID]))
    return CONCATENATEX(_c,[Product],"&")

    (3) Then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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