Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all!
I have a table containing all clients who ever placed an order. The coulmns are:
Date, Client ID, Order ID
What I want to find out is which clients who placed an order in current month, also placed an order in previous month. Or more precisely, Percent of buying customers in current month who bought last month. Does anyone have a suggestion on how to do this?
Thank you in advance!
Solved! Go to Solution.
For your requirement, you can create a full calendar table, then build relationship to your table on Date column. Then you can add a "Tag" column to tag if an users has order in previous month:
IsActive = IF ( CALCULATE ( COUNTROWS ( Table ), PREVIOUSMONTH ( Table[Date] ), ALLEXCEPT ( Table, Table[ClientID] ) ) > 0, 1, 0 )
Then you can easily calculate active users percentage with above column:
Active User Pct= CALCULATE ( DISTINCTCOUNT ( Table[ClientID] ), ALLEXCEPT ( Table, Table[Month] ), FILTER ( Table, Table[IsActive] = 1 ) ) / CALCULATE ( DISTINCTCOUNT ( Table[ClientID] ), ALLEXCEPT ( Table, Table[Month] ) )
Regards,
For your requirement, you can create a full calendar table, then build relationship to your table on Date column. Then you can add a "Tag" column to tag if an users has order in previous month:
IsActive = IF ( CALCULATE ( COUNTROWS ( Table ), PREVIOUSMONTH ( Table[Date] ), ALLEXCEPT ( Table, Table[ClientID] ) ) > 0, 1, 0 )
Then you can easily calculate active users percentage with above column:
Active User Pct= CALCULATE ( DISTINCTCOUNT ( Table[ClientID] ), ALLEXCEPT ( Table, Table[Month] ), FILTER ( Table, Table[IsActive] = 1 ) ) / CALCULATE ( DISTINCTCOUNT ( Table[ClientID] ), ALLEXCEPT ( Table, Table[Month] ) )
Regards,
Thank you for this Simon!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |