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.
Hello,
I have the following table where the Previous Month-Year column is a calculated column. and I'm trying to summarize the table by each vendor and the month-year.
Vendor | Month-Year | Type | Previous Month-Year |
A | 2-2021 | Debit Card | 1-2021 |
A | 2-2021 | Credit Card | 1-2021 |
B | 3-2021 | Debit Card | 2-2021 |
C | 5-2021 | Credit Card | 4-2021 |
D | 1-2022 | Credit Card | 12-2021 |
E | 2-2022 | Check | 1-2022 |
B | 9-2023 | Check | 8-2023 |
C | 7-2021 | Credit Card | 6-2021 |
D | 11-2022 | Debit Card | 10-2022 |
A | 8-2023 | Check | 7-2023 |
B | 12-2022 | Credit Card | 11-2022 |
C | 7-2023 | Debit Card | 6-2023 |
D | 8-2021 | Check | 7-2021 |
B | 1-2023 | Debit Card | 12-2022 |
I tried doing it as a calculated column to get a concatenated list for the current month based on the month-year column and then another calculated column to get a concatenated list for the previous month based on the previous month-year column as follows:
Vendor | Month-Year | Previous Month-Year | Current Month Payment Type | Previous Month Payment Type |
A | 2-2021 | 1-2021 | Debit Card, Credit Card |
|
B | 3-2021 | 2-2021 | Debit Card | Debit Card, Credit Card |
C | 5-2021 | 4-2021 | Credit Card |
|
D | 1-2022 | 12-2021 | Credit Card |
|
E | 2-2022 | 1-2022 | Check | Credit Card |
B | 9-2023 | 8-2023 | Check | Check |
C | 7-2021 | 6-2021 | Credit Card |
|
D | 11-2022 | 10-2022 | Debit Card |
|
A | 8-2023 | 7-2023 | Check | Debit Card |
B | 12-2022 | 11-2022 | Credit Card | Debit Card |
I appreciate any help!
is this what you want?
Table 2 =
var tbl=SUMMARIZE('Table','Table'[Vendor],'Table'[Month-Year],"current type",CONCATENATEX('Table',[Type],","),"previous",EDATE('Table'[Month-Year],-1))
var tbl2=ADDCOLUMNS(tbl,"previous type",maxx(FILTER(tbl,'Table'[Vendor]=EARLIER('Table'[Vendor])&&'Table'[Month-Year]=EARLIER([previous])),[current type]))
return tbl2
pls see the attachment below
Proud to be a Super User!
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 |
---|---|
109 | |
99 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
103 | |
82 | |
66 |