The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm looking to sum the value of a table but still have it relative to the year and vendor code. Currently I can only get it relative to one column, but finding it difficult to do two. The result would be the column in blue below.
Vendor Code | Description | Concat | Year | Value | Result |
MA33C4 | accountsreceivable | MA33C4accountsreceivable | 2021 | 1774 | 14194 |
MA33C4 | accountsreceivable | MA33C4accountsreceivable | 2020 | 1501 | 13904 |
MA33C4 | accountsreceivable | MA33C4accountsreceivable | 2019 | 1103 | 10484 |
MA33C4 | accountsreceivable | MA33C4accountsreceivable | 2018 | 4615 | 20214 |
MA33C4 | accountsreceivable | MA33C4accountsreceivable | 2017 | 6852 | 20017 |
MA33C4 | accountsreceivable | MA33C4accountsreceivable | 2016 | 1827 | 10004 |
MA33C4 | accountspayable | MA33C4accountspayable | 2021 | 1094 | 14194 |
MA33C4 | accountspayable | MA33C4accountspayable | 2020 | 1697 | 13904 |
MA33C4 | accountspayable | MA33C4accountspayable | 2019 | 2144 | 10484 |
MA33C4 | accountspayable | MA33C4accountspayable | 2018 | 3498 | 20214 |
MA33C4 | accountspayable | MA33C4accountspayable | 2017 | 3624 | 20017 |
MA33C4 | accountspayable | MA33C4accountspayable | 2016 | 1109 | 10004 |
MA33C4 | revenue | MA33C4revenue | 2021 | 1480 | 14194 |
MA33C4 | revenue | MA33C4revenue | 2020 | 1502 | 13904 |
MA33C4 | revenue | MA33C4revenue | 2019 | 1002 | 10484 |
MA33C4 | revenue | MA33C4revenue | 2018 | 7624 | 20214 |
MA33C4 | revenue | MA33C4revenue | 2017 | 5489 | 20017 |
MA33C4 | revenue | MA33C4revenue | 2016 | 4850 | 10004 |
MA33C4 | costofgoods | MA33C4costofgoods | 2021 | 9846 | 14194 |
MA33C4 | costofgoods | MA33C4costofgoods | 2020 | 9204 | 13904 |
MA33C4 | costofgoods | MA33C4costofgoods | 2019 | 6235 | 10484 |
MA33C4 | costofgoods | MA33C4costofgoods | 2018 | 4477 | 20214 |
MA33C4 | costofgoods | MA33C4costofgoods | 2017 | 4052 | 20017 |
MA33C4 | costofgoods | MA33C4costofgoods | 2016 | 2218 | 10004 |
RQ020G | accountsreceivable | RQ020Gaccountsreceivable | 2021 | 0 | 0 |
RQ020G | accountsreceivable | RQ020Gaccountsreceivable | 2020 | 1009 | 11802 |
RQ020G | accountsreceivable | RQ020Gaccountsreceivable | 2019 | 1903 | 12597 |
RQ020G | accountsreceivable | RQ020Gaccountsreceivable | 2018 | 1566 | 11546 |
RQ020G | accountsreceivable | RQ020Gaccountsreceivable | 2017 | 1083 | 13891 |
RQ020G | accountsreceivable | RQ020Gaccountsreceivable | 2016 | 0 | 0 |
RQ020G | accountspayable | RQ020Gaccountspayable | 2021 | 0 | 0 |
RQ020G | accountspayable | RQ020Gaccountspayable | 2020 | 4307 | 11802 |
RQ020G | accountspayable | RQ020Gaccountspayable | 2019 | 2743 | 12597 |
RQ020G | accountspayable | RQ020Gaccountspayable | 2018 | 2272 | 11546 |
RQ020G | accountspayable | RQ020Gaccountspayable | 2017 | 2397 | 13891 |
RQ020G | accountspayable | RQ020Gaccountspayable | 2016 | 0 | 0 |
RQ020G | revenue | RQ020Grevenue | 2021 | 0 | 0 |
RQ020G | revenue | RQ020Grevenue | 2020 | 3582 | 11802 |
RQ020G | revenue | RQ020Grevenue | 2019 | 4239 | 12597 |
RQ020G | revenue | RQ020Grevenue | 2018 | 4000 | 11546 |
RQ020G | revenue | RQ020Grevenue | 2017 | 5325 | 13891 |
RQ020G | revenue | RQ020Grevenue | 2016 | 0 | 0 |
RQ020G | costofgoods | RQ020Gcostofgoods | 2021 | 0 | 0 |
RQ020G | costofgoods | RQ020Gcostofgoods | 2020 | 2904 | 11802 |
RQ020G | costofgoods | RQ020Gcostofgoods | 2019 | 3712 | 12597 |
RQ020G | costofgoods | RQ020Gcostofgoods | 2018 | 3708 | 11546 |
RQ020G | costofgoods | RQ020Gcostofgoods | 2017 | 5086 | 13891 |
RQ020G | costofgoods | RQ020Gcostofgoods | 2016 | 0 | 0 |
Solved! Go to Solution.
Hey @anna-lee ,
You can use the code below:
SumValue =
CALCULATE (
SUM ( Table[Value] ),
ALLEXCEPT ( Table, Table[Vendor Code], Table[Year] )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hi @anna-lee
Please try
Result =
CALCULATE (
SUM ( 'Table'[Value] ),
ALLEXCEPT ( 'Table', 'Table'[Vendor Code], 'Table'[Year] )
)
Hey @anna-lee ,
You can use the code below:
SumValue =
CALCULATE (
SUM ( Table[Value] ),
ALLEXCEPT ( Table, Table[Vendor Code], Table[Year] )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
thank you!
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |