Forum Discussion
Find total using DAX in Matrix table
Hi All
I have a matrix table with 3 hierarchies (e.g. >$800 --> Apple --> 1.A), all my hierarchies and values are from the same Fact table. I'm trying to get the value (109,929) to calculate my Share % using DAX.
For example, the Share % for
- 1.A = 87,996 / 109,929
- Apple = 105,015 / 109,929
Does anyone know how I can get the total highlighted in Yellow?
Thanks,
BK
Hi, Anonymous
According to your description and sample picture, I think you want to use a measure to get the value in the Matrix you highlighted. Right? You can try this measure:
This is my test data based on your sample picture:
Measure = CALCULATE(SUM('Table'[Computer Units]),FILTER('Table',[Level 1]=">$800"))And you can get what the value, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 Replies
- Ashish_MathurSuper User
Hi,
Share the link from where i can download your PBI file.
- AnonymousNot applicable
Hi Ashish, thanks for the reply. Unfortunately I do not have a PBI with dummy date to share with you..
- parry2kSuper User
Anonymous here are the measures, first to simply sum the value and 2nd to calculate the %
Sales = SUM ( Table[Sales] ) % = DIVIDE ( [Sales], CALCULATE ( [Sales], ALLSELECTED ( Table[Lvl 2 Column], Table[Lvl 3 Column] ) )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- AnonymousNot applicable
Hi Parry, thanks for the reply. I'm managed to get the level 2 total with your help but that's not what I'm looking for. I would like to display level 1 total, not sure where went wrong..
Thanks, BK
- parry2kSuper User
Anonymous Just updated the measure, need to add level 3 column in the allselected as well
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- parry2kSuper User
Anonymous which measure you tried, I sent you the revised/updated measure.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- v-robertq-msftCommunity Support
Hi, Anonymous
According to your description and sample picture, I think you want to use a measure to get the value in the Matrix you highlighted. Right? You can try this measure:
This is my test data based on your sample picture:
Measure = CALCULATE(SUM('Table'[Computer Units]),FILTER('Table',[Level 1]=">$800"))And you can get what the value, like this:
You can download my test pbix file here
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.