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
Nalini
Regular Visitor

Display only multiple rows in table and don't display anything if it has only one row in table view

Hi,

 

I have a table which has A, B, C, D, E, F columns and i have created a table view in power Bi and added some slicers to the dashoboard. So now if someone filter the A column slicers and select only one number and data has only one row for it means my table should not display anything. below i have provided the screenshot(if if filter A as 1,2,4,6,7 those data row should not display in my table view and if i filter A as 3 then it should display all those data rows in the table view). I have tired the count based on A and B it didn't work. Any one can help me on this?

 

Nalini_0-1670406214336.png

 

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

Hi @rama211976 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a dimension table as below

A = VALUES('Table'[A])

yingyinr_0-1670482428464.png

2. Create a measure as below to get it:

Flag = 
VAR _selas =
    ALLSELECTED ( 'A'[A] )
VAR _taba =
    SELECTEDVALUE ( 'Table'[A] )
VAR _counta =
    CALCULATE (
        COUNT ( 'Table'[A] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[A] = _taba )
    )
RETURN
    IF ( _counta = 1, 0, IF ( _taba IN _selas, 1, 0 ) )

yingyinr_1-1670482552049.png

If the above one can't help you get the desired result, please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @rama211976 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create a dimension table as below

A = VALUES('Table'[A])

yingyinr_0-1670482428464.png

2. Create a measure as below to get it:

Flag = 
VAR _selas =
    ALLSELECTED ( 'A'[A] )
VAR _taba =
    SELECTEDVALUE ( 'Table'[A] )
VAR _counta =
    CALCULATE (
        COUNT ( 'Table'[A] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[A] = _taba )
    )
RETURN
    IF ( _counta = 1, 0, IF ( _taba IN _selas, 1, 0 ) )

yingyinr_1-1670482552049.png

If the above one can't help you get the desired result, please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Nalini , If you create a slicer on column A, it should filter whatever is selected in the slicer.

 

Not very clear, what is not working for you.

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

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.