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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
DevMaster
Regular Visitor

Unable to display values in Level2 and Level3 Matrix visual in Power Bi

I am trying to create Level1, Level2 and Level3 matrix visual and unable to display custom calculations in Level2. below is the sample data to construct the visual.

 

Data:

Level1Level2Level3Value
AAAAAA5
AAAAAAA10

 

Matrix Visual: Trying to display as mentioned below in Matrix visual but i am not able to display values in Level2

 

-A 
    --AA50

         ---AAA

5

         ---AAAA

10

 

How can this be handled?

 

Thanks & Best Regards,

AJ

2 ACCEPTED SOLUTIONS

If I understand you correctly and your desired result is : 

Ritaf1983_0-1686794265375.png

You can modify it from the subtotals format with these steps:

Ritaf1983_1-1686794443962.png

I also updated the linked file

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

View solution in original post

Thanks a lot. it resolves all my issues.

View solution in original post

9 REPLIES 9
Ritaf1983
Super User
Super User

Hi @DevMaster 
Hi the summarized matrix should look like this :

Ritaf1983_0-1686368476853.png

why on your example AA level is 50 if the total sum is 15?

thanks for your reply.

 

I am calculating average (5/10)*100 from backend and the data will come from SQL database. And i just want display the values only on Level2 & Level3

Hi @DevMaster  again 🙂

I'm still not sure I understand.
But if you just want to show levels 2 and 3 you can achieve it with DAX
According to the hierarchy level, it shows the calculation that you "tell" him

SunValue = if (ISFILTERED('Table'[Level2]),sum('Table'[Value]),if(ISFILTERED('Table'[Level1]),BLANK()))
Ritaf1983_1-1686383445698.png

 


If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

i am trying to calculate the percentage and show the values in Level2. Could you please share .pbix file 

Hi @DevMaster 
If I understand you correctly and your desired result is something like this :

Ritaf1983_0-1686631647914.png



Then you can follow these steps:
1. Add a calculated column for percentage:

Percentage =
 VAR __Current = 'Table'[Value]
  VAR __Previous = MAXX(FILTER('Table','Table'[Level2] = EARLIER('Table'[Level2])),[Level2])

  VAR __PreviousValue = MAXX(FILTER('Table',[Level2]=__Previous),[Value])
RETURN
DIVIDE( __Current,__PreviousValue)

 

Ritaf1983_1-1686631933567.png

2. Create a measure for the matrix:

MatrixValue = if (ISFILTERED('Table'[Level3]),SUM('Table'[Value]),
if(ISFILTERED('Table'[Level2]),format(min('Table'[Percentage]),"00%"),
blank()))

Ritaf1983_2-1686632049062.png

Link to a sample file 


If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Thank you for solution. Here i am facing one issue like i don't want to show Total text in the report. if i set subtotals option to off then values not showing. 

 

Could you please suggest that how we need to get rid off row/column subtotals.

If I understand you correctly and your desired result is : 

Ritaf1983_0-1686794265375.png

You can modify it from the subtotals format with these steps:

Ritaf1983_1-1686794443962.png

I also updated the linked file

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Thanks a lot. it resolves all my issues.

Happy to help, please  consider Accepting  all answers that help with different issues of this post as the solutions to help the other members find it more quickly

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.