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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply

Exclude Columns with ALL zero values

I have a matrix visual with conditional coloring and icons.  In order to accomplish this I had to convert NULLS into zeros.  However, I would like to exclude the columns that have all ZEROS.  In Power Query, when I remove the date columns with nulls I also loose the converted values to zero.  

Examples are included.  

The first image I have all dates with conditional formatting.  The columns in red with NO values at all need to not be there.  

The second image is the same matrix but I excluded the date column with NULLS which eliminates the columns with ALL Zeros but I also loose the Zeros for the other rows/columns and I need them for conditional formatting using values.  I can't replace the NULLS with zeros because they were filtered by removing the NULLS from the date column. 

I was thinking I could use the Grand Total of the column to exclude the column but it doesn't work. 

Any help is appreciated.Matrix.PNGMatrix2.PNG

8 REPLIES 8
procy
New Member

any luck with this at the end? thanks 🙂

v-jingzhang
Community Support
Community Support

Hi @marjoriefialek 

 

You can add a column to work as a flag: if the sum total value on a date is not zero, then flag is 1; if the sum total value on a date is zero, then flag is 0. Then apply this flag column to the matrix as a visual filter which sets value is 1.

Flag = IF(CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Date]))<>0,1,0)

010402.jpg

Kindly let me know if this helps.

Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Hello @v-jingzhang  I still loose the other zeros in the columns.  

 

 

marjoriefialek_0-1609860121092.png

 

 

 

@marjoriefialek 

I suggest remaining all Zeros rather than NULLs in Power Query just as the first image in your original post, then adding the flag column as a filter with value 1. Here is a sample PBIX file for reference. Let me know if you have any questions.

amitchandak
Super User
Super User

@marjoriefialek , you can try like this

measure  =

var _1 = calculate([measure], allexcept(Table[Date])) +0

return

calculate([measure],_1 <>0 )

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.  Show the problematic table and please remove the unnecessary tables and visuals from the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
aj1973
Community Champion
Community Champion

Hi,

In Power query unpivot the dates column and then use matrix in the desktop. 

see how it works out.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Unpivotting is multiplying the values but still loosing the zeros when I filter NULLS.   

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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