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
Anonymous
Not applicable

Table must be blank

I have a very simple table where I need to be in blank before using 2 text filters. is there a simple way to do it?

 

IMAGEN 1IMAGEN 1IMAGEN 2 DESIRED RESULTIMAGEN 2 DESIRED RESULT

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Yes @Anonymous but I don't think you can do it by putting the fields themselves into the table. You will need to replace those fields with measures. It gets this result:

BlankDataUntilSlicers.gif

The measure for field 1 is this:

Field1 Measure =
IF(
    ISBLANK(
        SELECTEDVALUE(
            Blanks[Field2],
            BLANK()
        )
    ),
    BLANK(),
    SELECTEDVALUE(
        Blanks[Field1],
        BLANK()
    )
)

Basically that is saying, if the selected value of field 2 is a single field, then see if field 1 is also single and show it, otherwise return blank.

 

Field 2 is identtical with teh field names swapped out as below:

Field1 Measure =
IF(
    ISBLANK(
        SELECTEDVALUE(
            Blanks[Field1],
            BLANK()
        )
    ),
    BLANK(),
    SELECTEDVALUE(
        Blanks[Field2],
        BLANK()
    )
)

Hopefully that helps.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

5 REPLIES 5
edhans
Super User
Super User

Yes @Anonymous but I don't think you can do it by putting the fields themselves into the table. You will need to replace those fields with measures. It gets this result:

BlankDataUntilSlicers.gif

The measure for field 1 is this:

Field1 Measure =
IF(
    ISBLANK(
        SELECTEDVALUE(
            Blanks[Field2],
            BLANK()
        )
    ),
    BLANK(),
    SELECTEDVALUE(
        Blanks[Field1],
        BLANK()
    )
)

Basically that is saying, if the selected value of field 2 is a single field, then see if field 1 is also single and show it, otherwise return blank.

 

Field 2 is identtical with teh field names swapped out as below:

Field1 Measure =
IF(
    ISBLANK(
        SELECTEDVALUE(
            Blanks[Field1],
            BLANK()
        )
    ),
    BLANK(),
    SELECTEDVALUE(
        Blanks[Field2],
        BLANK()
    )
)

Hopefully that helps.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

the solution seems to be limited...what if I add a thousands columns?... if it is gonna be that complicated to have an empty table...maybe I wont do it.

 

Let me show you the real pbix to see your opinion. I need to know if it worth it

 

https://www.dropbox.com/s/jjbpvzm4jbyaf9a/DATOS_JEFE_APTO.pbix?dl=0 

If you add thousands of columns, then you might want to rethink doing this in Power BI. 😉 I cannot imagine the scrolling left/right.

 

I am not aware of a way to do it with out a series of measures, either in the actual columns, or fields. Your original sample only had fields, no measures or amounts, so that is why I did it the way I did.

 

Personally, I'd  let the table show everything. Don't make your users know what they are looking for. Your approach prevents browsing the data, especially since you aren't using slicers, just text boxes to filter on.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

ohhh... too bad news super user.

Thanks anyways

Sorry we weren't able to get you exactly what you wanted @Anonymous - I marked my answer for your 2 column example as the solution as it did answer the specific data you provided. But for thousands of columns, it really won't work. That wasn't in the original request.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.