Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bvanevr
Frequent Visitor

DAX Need to create one Slicer that filters multiple column head if the column value is not blank

I have a table with 4 columns as regions and would like a slicer to be able to filter a region(s) - Mock up below.  The column filter needs apply only if the column has values.

 

Capture.PNG

 

So, if a user selects ("Asia" and "EMEA") then the table view would display Part A, B & C only since the "Asia" and "EMEA" values for Part D and E are null/empty.

 

Tried to use Value on a slicer from a Region table but it only allows for 1 selection and I need multiple

3 REPLIES 3
v-ljerr-msft
Employee
Employee

Hi @bvanevr,

 

If I understand you correctly, you should be able to follow steps below to get your expected result.

 

1. Unpivot the 4 columns in Query Editor. You'll get a new table like below. (For more details about how to Pivot and Unpivot with Power BI, you can refer to this article)

 

T1.PNG

 

2. Then you should be able to show Part column as Rows, Attribute column as Columns, Value column as Values on Matrix visual. And use Attribute column as Slicer to get the expected result.

 

r2.PNG

 

Here is sample pbix file for your reference. Smiley Happy

 

Regards

Thanks for the quick response.

 

While this works for the above problem, it causes another issue in that I am using this data set for other validations that check to see if there is a value in at least one of the regions.  The unpivot only creates rows for non null cells thus if a part does not have a region no record is maintained in the unpivot, so i am unable to test this second rule.

 

Preferred solution would keep the data structure as is and still provide the user the ability to filter by the regions.

Can you in Edit Queries and replace the nulls and blanks with 0 instead? This would create all the rows you need in the unpivot.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.