Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, I wanted to count the product based on the type defined below:
Each product should be counted as one in each month. How to create such measure?
Product | Term | Contract Start Date | Contract End Date | Installed Date |
A | Purchased | 02/13/2022 | 01/12/2023 | 01/10/2019 |
A | Warranty | 1/13/2021 | 02/12/2022 | 01/10/2019 |
B | Rental | 02/23/2022 | 02/22/2026 | 05/11/2009 |
B | Warranty | 02/23/2021 | 02/22/2022 | 05/11/2009 |
C | Rental | 05/01/2021 | 03/28/2022 | 05/09/2019 |
C | Rental | 09/29/2020 | 04/30/2021 | 05/09/2019 |
D | Warranty | 3/31/2021 | 03/30/2022 | 05/09/2019 |
D | Purchased | 3/31/2022 | 03/30/2026 | 05/09/2019 |
E | 02/13/2021 | |||
F | Purchased | 01/13/2021 | 01/12/2022 | 01/10/2019 |
F | Warranty | 1/13/2020 | 01/12/2021 | 01/10/2019 |
G | Warranty | 01/13/2021 | 03/12/2022 | 01/10/2019 |
H | Purchased | 12/13/2020 | 02/12/2022 | 01/10/2019 |
I | 03/13/2022 |
Expected Output:
Type | 2022-02 | 2022-03 |
Rental | 1 (C) | 2 (B,C) |
Contract | 1 (H) | 1 (A) |
Warranty | 4 (A,B,D,G) | 2 (D,G) |
T&M | 2 (E,F) | 4 (E,F,H,I) |
Sample pbix here. If a product is valid for both "Contract" & Warranty" in the same period, it should count only "Warranty" for that product. If a product is valid for both "Rental" & "Warranty" in the same month, it should count only "Warranty" for that product. How to do so?
The sum for T&M is incorrect? How to fix it?
@PBI_newuser , I think this approach of HT blog with active inactive join should help. What you need is very similar to Active employees
Hi @amitchandak , thank you for your suggestion.
I have created some measures in this sample pbix file. If a product is valid for both "Contract" & Warranty" in the same period, how to count only "Warranty" for that product. (E.g. Product A in 2022-02 and Product D in 2022-03) If a product is valid for both "Rental" & "Warranty" in the same month, how to count only "Warranty" for that product. (E.g. Product B in 2022-02)
Besides, the sum for T&M is incorrect? How to fix it?
User | Count |
---|---|
81 | |
77 | |
64 | |
48 | |
45 |
User | Count |
---|---|
103 | |
44 | |
39 | |
39 | |
37 |