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.
Dear All,
I need help on writing DAX for calculating the count of customers whose status flag is changing as shown in below table in a particular month.
1. Total number of distinct Customers for every month with max date.
2. Total number of distinct Customers Pending for every month..
CustomerNumber | CustomerStatus | Date |
1 | Approved | 8/18/2017 |
1 | Pending | 8/22/2016 |
2 | Withdrawn | 8/18/2017 |
2 | Pending | 8/22/2016 |
3 | Unlicensed | 6/5/2018 |
4 | Regular | 10/25/2016 |
5 | Regular | 4/11/2016 |
6 | Approved | 8/26/2016 |
6 | Pending | 4/21/2016 |
7 | Approved | 6/12/2018 |
7 | Unlicensed | 11/15/2016 |
8 | Approved | 7/28/2016 |
8 | Pending | 11/16/2017 |
9 | Pending | 11/25/2015 |
10 | Approved | 10/2/2015 |
11 | Approved | 5/24/2017 |
11 | Closed | 8/18/2017 |
11 | Pending | 6/26/2017 |
12 | Approved | 10/25/2016 |
13 | Unlicensed | 9/30/2016 |
14 | Approved | 10/11/2016 |
15 | Approved | 2/16/2017 |
15 | Closed | 6/5/2018 |
15 | Pending | 10/11/2016 |
Solved! Go to Solution.
Hi @shankyy7227,
1. Total number of distinct Customers for every month with max date.
Could you please provide more description? What is your desired result?
2. Total number of distinct Customers Pending for every month..
You could try this measure:
Measure 2 = CALCULATE ( DISTINCTCOUNT ( 'Example Data'[CustomerNumber] ), FILTER ( ALLEXCEPT ( 'Example Data', 'Example Data'[Date].[Month] ), 'Example Data'[CustomerStatus] = "Pending" ) )
Best regards,
Yuliana Gu
Hi @shankyy7227,
1. Total number of distinct Customers for every month with max date.
Could you please provide more description? What is your desired result?
2. Total number of distinct Customers Pending for every month..
You could try this measure:
Measure 2 = CALCULATE ( DISTINCTCOUNT ( 'Example Data'[CustomerNumber] ), FILTER ( ALLEXCEPT ( 'Example Data', 'Example Data'[Date].[Month] ), 'Example Data'[CustomerStatus] = "Pending" ) )
Best regards,
Yuliana Gu
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 |
---|---|
118 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |