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
MichaelSt
Frequent Visitor

Remove Empty Colums

Hi community,

I have an tabe that has the following format:
Based on a slider on a dropdown on Formname, The records of the table are filtered. 

Formname | SubmissionDate | FirstName | Lastname | Email | City | Address

Sometimes for a specific Formname, the Email, city, Adress or other n colums are empty. 
The customer really wants to get the table filtered and remove the colums that are empty from the report and from the export of the data. I dont know how the handle this problem. 
I thought about a measure that filters the table and removes the blank columns, but I'm not skilled enough to do that. 
Do I even have chances here to achive this with dax?
Thanks in advance!

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

Hi @MichaelSt ,

You could try the following steps:

Step1: create a measure like below:

Measure = 
IF (
    MAX ( 'Table'[SubmissionDate ] ) = BLANK ()
        || MAX ( 'Table'[FirstName] ) = BLANK ()
        || MAX ( 'Table'[FirstName] ) = BLANK ()
        || MAX ( 'Table'[Lastname] ) = BLANK ()
        || MAX ( 'Table'[Email] ) = BLANK ()
        || MAX ( 'Table'[City] ) = BLANK ()
        || MAX ( 'Table'[Address] ) = BLANK (),
    BLANK (),
    1
)

Step 2: configure the filters:

v-luwang-msft_0-1616742128657.png

 

base data:

v-luwang-msft_1-1616742153706.png

 

and final:

v-luwang-msft_2-1616742168187.png

 

 

Wish it is helpful for you!

Best Regards

Lucien

 

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @MichaelSt ,

You could try the following steps:

Step1: create a measure like below:

Measure = 
IF (
    MAX ( 'Table'[SubmissionDate ] ) = BLANK ()
        || MAX ( 'Table'[FirstName] ) = BLANK ()
        || MAX ( 'Table'[FirstName] ) = BLANK ()
        || MAX ( 'Table'[Lastname] ) = BLANK ()
        || MAX ( 'Table'[Email] ) = BLANK ()
        || MAX ( 'Table'[City] ) = BLANK ()
        || MAX ( 'Table'[Address] ) = BLANK (),
    BLANK (),
    1
)

Step 2: configure the filters:

v-luwang-msft_0-1616742128657.png

 

base data:

v-luwang-msft_1-1616742153706.png

 

and final:

v-luwang-msft_2-1616742168187.png

 

 

Wish it is helpful for you!

Best Regards

Lucien

 

pranit828
Community Champion
Community Champion

HI @MichaelSt 

Create a measure as below and use it in the Filter section of the report and set it always filter to 1.

-Filter = IF(ISBLANK(Formname) || ISBLANK(SubmissionDate) || ISBLANK(FirstName) || ISBLANK(Lastname) || ISBLANK(Email) || ISBLANK(City) || ISBLANK(Address), 0, 1)





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

Hi, thanks for your answer first of all.
I guess thats not quite what I'm looking for. Thats a DAX for a calculated column, not for a Measure, right? At least I can only use it there..

Either way doesn't the filter remove columns. It would only filter the rows right?
I need to remove the columns if they are empty from the Visual

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.