March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi everyone,
I have tried several ways but I am unable to calculate percentage for the below:
I am trying to calculate percentage for NSW and VIC (see below table)
NSW Local = Local/(Local+Overseas)
NSW Overseas = Overseas/(Local+Overseas)
The above calculation should also be based on Year. Hope you guys can help. Thanks
DM | KIC | Currency | Year | Amount |
ABC | NSW | Local | 2019 | 500 |
XYZ | VIC | Local | 2019 | 600 |
XYZ | VIC | Local | 2020 | 120 |
ABC | VIC | Overseas | 2019 | 800 |
ABC | NSW | Local | 2020 | 500 |
XYZ | VIC | Local | 2021 | 100 |
ABC | VIC | Overseas | 2019 | 900 |
ABC | VIC | Local | 2020 | 100 |
XYZ | NSW | Overseas | 2021 | 780 |
XYZ | VIC | Overseas | 2019 | 980 |
ABC | NSW | Local | 2020 | 123 |
ABC | NSW | Local | 2021 | 120 |
XYZ | VIC | Overseas | 2019 | 794 |
XYZ | VIC | Local | 2020 | 852 |
XYZ | NSW | Local | 2019 | 258 |
ABC | NSW | Overseas | 2021 | 1470 |
XYZ | VIC | Local | 2022 | 125 |
ABC | VIC | Overseas | 2022 | 423 |
XYZ | VIC | Local | 2022 | 324 |
ABC | VIC | Overseas | 2022 | 861 |
Solved! Go to Solution.
Hi @PXJ ,
I suggest you to create a measure and show it in a matrix.
Percentage =
VAR _AMOUNT =
CALCULATE ( SUM ( 'Table'[Amount] ) )
VAR _TOTAL =
CALCULATE (
SUM ( 'Table'[Amount] ),
ALLEXCEPT ( 'Table', 'Table'[Year], 'Table'[KIC] )
)
RETURN
DIVIDE ( _AMOUNT, _TOTAL )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PXJ ,
I suggest you to create a measure and show it in a matrix.
Percentage =
VAR _AMOUNT =
CALCULATE ( SUM ( 'Table'[Amount] ) )
VAR _TOTAL =
CALCULATE (
SUM ( 'Table'[Amount] ),
ALLEXCEPT ( 'Table', 'Table'[Year], 'Table'[KIC] )
)
RETURN
DIVIDE ( _AMOUNT, _TOTAL )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |