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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply

Remove unwanted lines of data?

Hi all - I have a dataset where there can be multiple lines of data, per event (see link below - sample data) but I only want to have the lines of datsa which have an actual dosage in it, rather than just zero.  So, in the sample data, you'll see the same event key, but there is often a 'rogue' line of data which has same event key but a zero.  This zero IS in the data, but for analysis purposes I want to exclude it as a line of data - only showing the event key line with something in it.

 

Many thanks all.

 

Sample Data 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Creative_tree88 

 

You can filter it out within the measure:

CALCULATE (
    SUM ( 'table'[dosage] ),
    FILTER ( VALUES ( 'table'[dosage] ), 'table'[dosage] <> 0 )
)

 

You can use the query editor to filter it out

danextian_0-1738848707905.png

Or exclude using the filter pane

danextian_1-1738848806733.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

1 REPLY 1
danextian
Super User
Super User

Hi @Creative_tree88 

 

You can filter it out within the measure:

CALCULATE (
    SUM ( 'table'[dosage] ),
    FILTER ( VALUES ( 'table'[dosage] ), 'table'[dosage] <> 0 )
)

 

You can use the query editor to filter it out

danextian_0-1738848707905.png

Or exclude using the filter pane

danextian_1-1738848806733.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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