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.
I want to create a column that if it is found to be null the width of the column will go to zero and essentially disappear. If the column is not null then it will set the column width to a certain size and fill in the column with the proper values. I am trying to use this as a way to kind of have a work around in having dynamic columns that change based off of slicer selection. Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
There is no such an visibility option that supports to conditionally hide/show column in Matrix. For such needs, you may consider voting for similar ideas in Power BI Ideas.
Links of similar ideas: https://ideas.powerbi.com/ideas/search-ideas/?q=hide%20column%20in%20matrix and https://ideas.powerbi.com/ideas/idea/?ideaid=5f080970-9ddc-4d8b-8e51-8519eef2ce60.
If you want the width of the column dynamically change according to the length of its values, you need enable Auto-size column width firstly.
Then currently, one option is to hide or show the values in the column by creating measures, but It depends how you create your matrix visual.
Here are the sample data used.
If use Project as Rows and status as Columns of Matrix visual, and take a Measure that do calculation for it as Values, then Matrix visual will look like the following screenshot.
status_ =
VAR count_selected =
CALCULATE (
COUNTBLANK ( 'Table'[status] ),
'Table'[Project] = SELECTEDVALUE ( 'Table'[Project] )
)
VAR count_selected_ =
CALCULATE (
COUNT ( 'Table'[status] ),
'Table'[Project] = SELECTEDVALUE ( 'Table'[Project] )
)
RETURN
IF ( count_selected = count_selected_, BLANK (), MAX ( 'Table'[status] ) )
But if you create Matrix with Project as Rows and with no field as Column, column headers are still appeared even there is no data.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @Anonymous ,
There is no such an visibility option that supports to conditionally hide/show column in Matrix. For such needs, you may consider voting for similar ideas in Power BI Ideas.
Links of similar ideas: https://ideas.powerbi.com/ideas/search-ideas/?q=hide%20column%20in%20matrix and https://ideas.powerbi.com/ideas/idea/?ideaid=5f080970-9ddc-4d8b-8e51-8519eef2ce60.
If you want the width of the column dynamically change according to the length of its values, you need enable Auto-size column width firstly.
Then currently, one option is to hide or show the values in the column by creating measures, but It depends how you create your matrix visual.
Here are the sample data used.
If use Project as Rows and status as Columns of Matrix visual, and take a Measure that do calculation for it as Values, then Matrix visual will look like the following screenshot.
status_ =
VAR count_selected =
CALCULATE (
COUNTBLANK ( 'Table'[status] ),
'Table'[Project] = SELECTEDVALUE ( 'Table'[Project] )
)
VAR count_selected_ =
CALCULATE (
COUNT ( 'Table'[status] ),
'Table'[Project] = SELECTEDVALUE ( 'Table'[Project] )
)
RETURN
IF ( count_selected = count_selected_, BLANK (), MAX ( 'Table'[status] ) )
But if you create Matrix with Project as Rows and with no field as Column, column headers are still appeared even there is no data.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
@Anonymous
Can you provide more details about your measures, data model, your matrix visual and the slicers. Maybe we can find a workaround on your workaround.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
17 | |
12 |