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.
I have a small data which has two tables in it. Sales table contains the two columns, Order Date, Customer Name, and Date Table contains the Date column with two years of data (2015 and 2016).
I need to find the No. of Customers that were there in the Last Year data as well as in the Current Year data.
Solved! Go to Solution.
Hi @amirabedhiafi ,
You can use the following measure:
Measure = SUMX(SUMMARIZE(Sales,Sales[Customer Name],"salesin both year",var a = CALCULATE(COUNT(Sales[Customer Name]),FILTER('Date','Date'[Date].[Year]=Year(Today()-1))) var b = CALCULATE(COUNT(Sales[Customer Name]),FILTER('Date','Date'[Date].[Year]=Year(Today())) return IF(a+b>=2,1,0)),[salesin both year])
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @amirabedhiafi ,
You can use the following measure:
Measure = SUMX(SUMMARIZE(Sales,Sales[Customer Name],"salesin both year",var a = CALCULATE(COUNT(Sales[Customer Name]),FILTER('Date','Date'[Date].[Year]=Year(Today()-1))) var b = CALCULATE(COUNT(Sales[Customer Name]),FILTER('Date','Date'[Date].[Year]=Year(Today())) return IF(a+b>=2,1,0)),[salesin both year])
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
You could count the unique customer names in your order table like so.
Customer Count = DISTINCTCOUNT ('Table 1'[Customer Name])
Then you make a visual with the year from your date table and that measure which should give you what you are looking for.
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |