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
DavidH
Helper I
Helper I

Segregation of data based on multiple tables

I am trying to look at generating a model that displays information about who in the organisation can deliver products based on their skills.

 

So if you select an employee this will show all the products and services that they are able to deliver. The attached picture hopefully captures sufficinet information to get the problems across.

 

I have a feeling that some measure branching of virtual tables may be needed??

 

Any suggestions appreciated!

 

Regards,

 

DavidH

Data exampleData example

1 ACCEPTED SOLUTION

Ok I have managed to solve this one!

 

I created a distinct list of Product Codes and then used this for the relationship between Product and Empoyees.

Created a measure to determine the 'score' needed 
Product Score = CALCULATE( COUNTROWS( 'Product Codes' ) ) * 2

 

Created a measure to calculate the employee score for each Product
Employee Check Y/N = IF( ISFILTERED( 'Employee Authorisations'[Employees] ),
                        IF( CALCULATE( SUMX( 'Employee Authorisations', 'Employee Authorisations'[Level] ),
                        TREATAS( VALUES( 'Product Codes'[Code ID] ), 'Employee Authorisations'[Code ID] ) ) = [Product Score],
                        "Authorised", BLANK() ),
                     BLANK() )

 

If there are any suggested alternate solutuions I would be interested to know!

Result.PNG

Regards,

 

DavidH

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Well, you will want to unpivot the Code# columns in that first table.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Greg,

 

Forgive me I should have been specific about the initial setting up of the data. Obviously simple data transformations will need to be completed before committing the data in to the model.

 

Basic DAX to determine how many codes for a product exist but its the segregation and and ability to capture what an employee is able to deliver which is the main question.

 

DavidH

Ok I have managed to solve this one!

 

I created a distinct list of Product Codes and then used this for the relationship between Product and Empoyees.

Created a measure to determine the 'score' needed 
Product Score = CALCULATE( COUNTROWS( 'Product Codes' ) ) * 2

 

Created a measure to calculate the employee score for each Product
Employee Check Y/N = IF( ISFILTERED( 'Employee Authorisations'[Employees] ),
                        IF( CALCULATE( SUMX( 'Employee Authorisations', 'Employee Authorisations'[Level] ),
                        TREATAS( VALUES( 'Product Codes'[Code ID] ), 'Employee Authorisations'[Code ID] ) ) = [Product Score],
                        "Authorised", BLANK() ),
                     BLANK() )

 

If there are any suggested alternate solutuions I would be interested to know!

Result.PNG

Regards,

 

DavidH

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.