Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

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?

 

2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

Thanks, 

BK

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community 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:

v-robertq-msft_0-1611726815473.png

Measure =

CALCULATE(SUM('Table'[Computer Units]),FILTER('Table',[Level 1]=">$800"))

 

And you can get what the value, like this:

v-robertq-msft_1-1611726815480.png

 

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.

View solution in original post

7 REPLIES 7
v-robertq-msft
Community Support
Community 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:

v-robertq-msft_0-1611726815473.png

Measure =

CALCULATE(SUM('Table'[Computer Units]),FILTER('Table',[Level 1]=">$800"))

 

And you can get what the value, like this:

v-robertq-msft_1-1611726815480.png

 

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.

parry2k
Super User
Super 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not 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..

3.jpg

 

 

 

 

 

 

 

 

 

 

Thanks, BK

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish, thanks for the reply. Unfortunately I do not have a PBI with dummy date to share with you..

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.