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
joshua1990
Post Prodigy
Post Prodigy

Show available columns based on selection

Hi community!

I have a simple data model with 3 tables:

tblArticle

Article Price Size
A 50 40
B 60 50

This table shows me attributes for each article.

 

Then I have a second dimension table that shows me the required/planned process steps to be manufactured:

Article Process Step Nr Description
A 01A Packaging
A 02A Mounting
A 03A Drilling
B 01B Packaging
B 02B Drilling
C 06C Drilling

 

We have different Process Steps for each Article. This table is linked with Article with the first table.

 

And then I have a transaction table that shows me if a process steps has already started or finished. Planned Process steps are not displayed. This table is linked with Article with the first table.

Article Date Process Step Status
A 01.01.2022 01 Finished
A 01.01.2022 02 Started
B 01.01.2022 01 Started

 

Now I would like to create a matrix that shows me in rows the article and in columns the status per process step. But if a planned process steps has not started yet, I would like to see the string "Open". The displayed columns should be filtered / based on the selected articles. I don't want to see all process steps from the second table. Just the ones that are linked to the selected articles:

 

Article 01A 02A 03A 01B 02B
A Finished Started Open NA NA
B NA NA NA Started Open

 

If a process step is not applicable / available for a selected article, then we should display "NA".

 

How would you do that? 

 

1 ACCEPTED SOLUTION
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @joshua1990 - I would suggest using Power Query to modify the data model to achieve this result in a matrix:

DarylLynchBzy_0-1666429197403.png

The key is create the following table which is combination of tables 2 and 3:

DarylLynchBzy_1-1666429297671.png

note the "N/A" are added using the SELECTVALUE function.  This replaces blanks, but it would also replace Duplicates, so be careful with duplicated status.

 

Also make sure that tblArticles includes all the Articles.

 

Many thanks

Daryl

 

 

 

View solution in original post

3 REPLIES 3
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Roache's Maxim - transform data as far upstream as possible, and downstream only when necessary.  Hopefully the transformation will fold to your data source.  With the approach the DAX is much simpler.

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @joshua1990 - I would suggest using Power Query to modify the data model to achieve this result in a matrix:

DarylLynchBzy_0-1666429197403.png

The key is create the following table which is combination of tables 2 and 3:

DarylLynchBzy_1-1666429297671.png

note the "N/A" are added using the SELECTVALUE function.  This replaces blanks, but it would also replace Duplicates, so be careful with duplicated status.

 

Also make sure that tblArticles includes all the Articles.

 

Many thanks

Daryl

 

 

 

 @Daryl-Lynch-Bzy : Thanks a lot! But why would you do that in Power Query instead of DAX? Since it is a really huge table, I would assume it would be better to calculate this in DAX?

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.