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
PreetiSahu321
Helper I
Helper I

Delete empty rows using Power BI DAX

Hello Power BI Community Members,

Below represents a dummy Power BI table with one ID Column, Four date columns and one project name column which makes a couple of duplicates.

 

Here one project name had the date information which I need and one did not have any date data that means I want to delete the duplicate rows where there is no data under the 'dates' columns.

I want to delete these empty rows (i.e. Project 1 with ID 111, Project 3 and Project 4) by using the Power BI DAX.

 

1234.png

 

Can anyone suggest to me what I have to do in this case?

Thanks in Advance!!!

4 REPLIES 4
az38
Community Champion
Community Champion

@PreetiSahu321 

also, you can try a calculated column 

isThereAnyDate = if(ISBLANK('Table'[Date1]) && ISBLANK('Table'[Date2]) && ISBLANK('Table'[Date3]) && ISBLANK('Table'[Date4]),false(),true())

then filter your data by isThereAnyDate = true condition

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
az38
Community Champion
Community Champion

Hi @PreetiSahu321 

there are 2 options

 

first (and prefferably from my point of view), you can just set as inactive "Show items with no data" in visual field Project name settings

second, you can create a calculated table like

Filtered Table = FILTER(
ALL('Table'),
NOT(ISBLANK('Table'[Date1])) || NOT(ISBLANK('Table'[Date2])) || NOT(ISBLANK('Table'[Date3])) || NOT(ISBLANK('Table'[Date4]))
)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Interesting approach above. I attempted the above solution and resulted in an error.

However, I was able to replicate a solution using measures to calculate the MAX Date for each date column.

 

example.png

 

MAX Date1 = MAX ( table[date1] )

MAX Date2 = MAX ( table[date2] )

MAX Date3 = MAX ( table[date3] )

MAX Date4 = MAX ( table[date4] )

 

Visual is Table w/

Project, and the newly created measures.

@AlexAlberga727 

i see the only possible error in the statement above - using comma "," as delimiter but not semicolon ":". It is the locale question and it is not error

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.

Top Solution Authors