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
jyaul786
Helper II
Helper II

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

 

16 REPLIES 16
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 👍

Hello @DOLEARY85 

Its working fine but when i export date from matrix, i got only Assets. could you please help ?

jyaul786_1-1701926374913.png

 

 

Exported data:

jyaul786_0-1701926303350.png

 

@DOLEARY85 

Kindly Reminder please, its really very important.

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

Hello, @Ahmedx 

 

I agian tried your file even i cant export complete data, could you please help me if you can.

or there is any another way to do this ?

jyaul786_0-1703763790018.png

 

 

 

Exported data:

Level1Level2Level3Level4value measure
Assetcurrentbankbank110
Assetcurrentgsgs111
Assetfixedlandland112

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