cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
jyaul786
Helper I
Helper I

Hide/remove matrix rows

Dear Friend,

i have one table with Level1,Level2,Level3,Level4 and value, i want to display in Matrix with hierarchy.

Data:

Level1Level2Level3Level4value
Assetcurrentbankbank110
Assetcurrentgsgs111
Assetfixedlandland112
IncomeDirect  13
IncomeIndirect  14
ExpenseDirectexpense1 15
ExpenseIndirectexpense2 16

Matrix:

jyaul786_1-1700553533571.png

i dont have Level 3 and Level 4 for certain row, how can remove of that rows as mark below. i want to hide or remove the mark rows. Could you please help

 

jyaul786_0-1700553428870.png

 

1 ACCEPTED SOLUTION

Strange it works with the test data you provided, without being able to view your file i'm not sure what other solution could work.

 

I've attached my PBIX file for you to review, hopefully it will provide some additional help:

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

13 REPLIES 13
DOLEARY85
Super User
Super User

Hi,

 

try this measure to replace your value field in the matrix:

 

Value Measure= SWITCH(TRUE(),and(ISINSCOPE('Table'[Level3]),ISBLANK(VALUES('Table'[Level3]))),BLANK(),and(ISINSCOPE('Table'[Level4]),ISBLANK(VALUES('Table'[Level4]))),BLANK(),SUM('Table'[value]))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

i tried your measure but i have still empty rows as:

measure=

SWITCH(
   TRUE(),
   and(ISINSCOPE('Table test'[Level3]),ISBLANK(VALUES('Table test'[Level3]))),BLANK(),
   and(ISINSCOPE('Table test'[Level4]),ISBLANK(VALUES('Table test'[Level4]))),BLANK(),SUM('Table test'[value])
   )

 

jyaul786_0-1700568385666.png

 

Strange it works with the test data you provided, without being able to view your file i'm not sure what other solution could work.

 

I've attached my PBIX file for you to review, hopefully it will provide some additional help:

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

your method will only work if you create a hierarchy

If you replace the hierarchy in rows of the matrix with the individual lvl 1 - 4 fields it still works in the sample PBIX file I uploaded.

I understand why it doesn't work for me. the column is not empty. this will work:

Screenshot_1.png

Ah yes, apologies - i forgot to mention i also used Power Query to change the empty cells to null before using DAX, but yes this would be another way to do it without Power Query.

it works in your file, but not in others
try my file.
I'm wondering why your file works and in others the measure doesn't work

Ahmedx
Super User
Super User

Share sample pbix file to help you.

i have some restrictions here so that i can't share pbix. this is simple pbix file with sample data:

Level1Level2Level3Level4value
Assetcurrentbankbank110
Assetcurrentgsgs111
Assetfixedlandland112
IncomeDirect  13
IncomeIndirect  14
ExpenseDirectexpense1 15
ExpenseIndirectexpense2 16

 

u can develop and test. thanks for your time and cooperation.

pls try againe

Screenshot_1.png

Ahmedx
Super User
Super User

try this

Flag = IF(MAX(Level 3) = BLANK()||MAX(Level 4)=BLANK(),0,1)

throw the measure on visual level ,  You can apply visual level filters in that you can select 1

Hello,

i tried but complete Level 1 Income,Expense also filter.

 

jyaul786_0-1700555302645.png

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors