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
Anonymous
Not applicable

Fetch Value from Table 2 relations away

Hello!

 

I am having some trouble with my data.

 

I have three tables: Table1, Table2, Table3

 

Table2 contains a list of sessions containing information about sessions. Each session has a client ID, a session module and type of session, and a session ID. For a client, all appointments within the same module will have the same type.

 

Table1 contains the list of required sessions per module, separated per session type.

 

Table3 should contain a list of the clients + required sessions per module depending on the type of session they will be having for that module.

 

Table2:

 

ClientIDSession ModuleSession TypeSessionID
11A1
11A2
12A3
13B4
21A5
22B6
22B7
23B8

 

Table1:

 

Session TypeModule1Module2
A35
B46

 

 

DESIRED Table3:

 

ClientModule1Module2
135
236

 

 

I have the following connections:

 

Table1[Session Type] is connected to Table2[Session Type]

Table2[Client ID] is connected to Table3[Client ID]

 

So the process is, for every client, for every module, I need to check the type of session the client will be taking that module. Based on the type of session for that module, I need to get the required number of sessions from Table3.

 

(The end goal is to check the percentage of sessions a client has done for each module, but the type of session can change from module to module and I haven't managed to assign the required number of sessions per client).

 

How would I go about doing this? Table3 and Table1 don't share a connection. 

 


Thank you in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, for your case i've tranformed  your tables to make relationship between "Session Type+Module" columns.

 

Please note, for table1, i perform unpivot to "module1" and "module2" columns, after unpivot i've changed the values "module1" and "module2" to "1" and "2". The result of unpivot is "Session Module" Column, then i've created "Session Type + Module" column as result to concatenate "Session Module" and "Session Type" columns.

 

For table2 i've only concatenate "Session Module" and "Session Type".

 

The measures created was:

#Sessions Done = DISTINCTCOUNT(Table2[SessionID])
#Sessions Needed = SUM(Table1[Session Needed])
Sessions Done / Sessions Needed = IF(ISBLANK([#Sessions Needed]),BLANK(), [#Sessions Done]/[#Sessions Needed])
 

sessions.png

 

I hope to help you.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, for your case i've tranformed  your tables to make relationship between "Session Type+Module" columns.

 

Please note, for table1, i perform unpivot to "module1" and "module2" columns, after unpivot i've changed the values "module1" and "module2" to "1" and "2". The result of unpivot is "Session Module" Column, then i've created "Session Type + Module" column as result to concatenate "Session Module" and "Session Type" columns.

 

For table2 i've only concatenate "Session Module" and "Session Type".

 

The measures created was:

#Sessions Done = DISTINCTCOUNT(Table2[SessionID])
#Sessions Needed = SUM(Table1[Session Needed])
Sessions Done / Sessions Needed = IF(ISBLANK([#Sessions Needed]),BLANK(), [#Sessions Done]/[#Sessions Needed])
 

sessions.png

 

I hope to help you.

Anonymous
Not applicable

Thank you a lot!

 

That did solve my problem, thank you so much for the help.

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.