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
paolomint
Helper III
Helper III

Remove rows (in visualization) with no values in several columns

Hi,

my table has a lot of zero in several columns:

 

 STOCK ITSTOCK FRSTOCK US
SHOES1000
SHIRT0140
HAT0022
GLASSES000
TIE33660
SOCKS0045
BELT000

 

How can I obtain the following result in visualization?

 

 STOCK ITSTOCK FRSTOCK US
SHOES1000
SHIRT0140
HAT0022
TIE33660
SOCKS0045

 

I need to keep only rows with at least one value on several columns.

thank you very much

Paolo

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @paolomint 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

You may create a measure as below.

Visual Control = 
var _result = 
CALCULATE(
    SUM('Table'[Value]),
    ALLEXCEPT('Table','Table'[Category])
)
return
IF(
    _result>0,
    1,0
)

 

Then you need to put the measure in the visual level filter to get the result.

d2.png

 

Best Regards

Allan

 

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

8 REPLIES 8
v-alq-msft
Community Support
Community Support

Hi, @paolomint 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

You may create a measure as below.

Visual Control = 
var _result = 
CALCULATE(
    SUM('Table'[Value]),
    ALLEXCEPT('Table','Table'[Category])
)
return
IF(
    _result>0,
    1,0
)

 

Then you need to put the measure in the visual level filter to get the result.

d2.png

 

Best Regards

Allan

 

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

Anand24
Super User
Super User

Hi @paolomint ,

 

Why not create a simple zero check column with conditions and filter on that column.

 

Refer below image:

zero.PNG

 

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

Fowmy
Super User
Super User

@paolomint 

NEW MEASURE = 

IF (
  CALCULATE(
  [MEASURE],
  ALLSELECTED(TABLE[COLUMN])
 ) > 0 ,

[MEASURE],
BLANK()
)

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

thankyou @Fowmy 

 

unfortunatelly, I can not do this way,

if I use the measure you proposed I will have the following result:

 

STOCK ITSTOCK FRSTOCK US
SHOES10  
SHIRT 14 
HAT  22
TIE3366 
SOCKS  45

 

I need value zero when there is a value on at least one other column, not blank

thank you

paolo

@paolomint 

Can you share the measure you used?

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

 

@Fowmy 

all the measure are like this:

(CALCULATE(sum('BUDGET CA'[BdgCR]),'MODELLO CE'[CatId1]=1) ) +0
 
I add "+0" to avoid blank value.
but doing this way, I need to manage the rows with only zero values.
 
If I do this way 
CALCULATE(sum('BUDGET CA'[BdgCR]),'MODELLO CE'[CatId1]=1)
I have several blank values, and it is not suitable for my aim.
 
STOCK ITSTOCK FRSTOCK US
SHOES10  
SHIRT 14 
HAT  22
TIE3366 
SOCKS  45
 
Thanks for your attention
 
 
 

Hi @paolomint 

I would create a measure and add all the column in it.

Sum_Measure = [Col1] + [col2] + [Col3] + ...

 

And create a filter in the filter pane to display when the Sum_Measure is greater than 0.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

@paolomint

This is your Existing Measure, You can replace your calculation

Existing Measure = SUM(DATA[VALUE])+0

Create a new measure which you will uuse in the matrix:

New Measure = 

IF (
    CALCULATE (
        [Existing Measure],
        ALLSELECTED (DATA[COUNTRY]))> 0,
        [Existing Measure],
    BLANK ()
    )

Fowmy_0-1598195259566.png

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, Linkedin





Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.