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
Aperszon
Frequent Visitor

Show related items to set filter

Hello, 

 

I am having some trouble with a formula. 

 

Essentially what I am trying to achieve is this: my final report is filtered based on Phase ID, this will then show the Memo ID's linked to this phase. However 1 memoID has 1 to X relationship with PhaseId. So what I would then like to see is all the related phases to these memos.

 

For example I would select PhaseID 61. 

Aperszon_0-1663594777890.png

 

What I would then like to see as result is the related phases to above shown MemoID's. (below screenshot only for vizualisation)

 

Aperszon_2-1663594986396.png

 

 

MemoIDPhaseIDCount

1.0.1.1112
1.0.1.1171
1.0.1.1181
1.0.1.1191
1.0.1.11152
1.0.1.11651
1.0.14.20311
1.0.1.15321
1.0.14.20322
1.0.1.11561
1.0.1.15601
1.0.14.20602
1.A.18.17603
1.A.18.1604
1.A.12.8611
1.A.12.7612
1.B.18.7613
1.B.18.2614
1.0.14.20615
1.0.1.15616
1.A.18.1617
1.0.1.11618
1.0.1.11632
1.A.18.1634
1.0.14.206310
1.0.1.156311

 

Thank you in advance for any tips and tricks

1 ACCEPTED SOLUTION

Hi @Aperszon 
Apologies for the late resonse.
It has to be a disconnected table. If the table 'Phase" has to be connected with table 'Memo_Phase' then you need to create a seperate table for the slicer as follows

1.png

Slicer Table = VALUES ( Phase[ID] )

2.png

The adjust the filter measure as follows

3.png

Filter Measure = 
VAR CurrentMemo = SELECTEDVALUE ( Memo_Phase[MemoID] )
VAR SelectedPhase = SELECTEDVALUE ( 'Slicer Table'[ID] )
VAR SelectedMemos = CALCULATETABLE ( VALUES ( Memo_Phase[MemoID] ), ALL ( Memo_Phase ), Memo_Phase[PhaseID] = SelectedPhase )
RETURN
    IF ( CurrentMemo IN SelectedMemos, 1 )

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @Aperszon 
Sorry for the late reply. I hope this is what you're looking for.

1.png2.png

Filter Measure = 
VAR CurrentMemo = SELECTEDVALUE ( Memo_Phase[MemoID] )
VAR SelectedPhase = SELECTEDVALUE ( Phase[ID] )
VAR SelectedMemos = CALCULATETABLE ( VALUES ( Memo_Phase[MemoID] ), ALL ( Memo_Phase ), Memo_Phase[PhaseID] = SelectedPhase )
RETURN
    IF ( CurrentMemo IN SelectedMemos, 1 )

@tamerj1 

 

Thank you very much, this is awesome 🙂  The measure is 90% there. 

 

once I add in the relationships to Phase and Memo the Measure fails. would you know what would affect this?

 

Before Relationship set

Aperszon_0-1663746223038.png

 

After added Relationship. 

Aperszon_1-1663746260705.png

 

 

 

Hi @Aperszon 
Apologies for the late resonse.
It has to be a disconnected table. If the table 'Phase" has to be connected with table 'Memo_Phase' then you need to create a seperate table for the slicer as follows

1.png

Slicer Table = VALUES ( Phase[ID] )

2.png

The adjust the filter measure as follows

3.png

Filter Measure = 
VAR CurrentMemo = SELECTEDVALUE ( Memo_Phase[MemoID] )
VAR SelectedPhase = SELECTEDVALUE ( 'Slicer Table'[ID] )
VAR SelectedMemos = CALCULATETABLE ( VALUES ( Memo_Phase[MemoID] ), ALL ( Memo_Phase ), Memo_Phase[PhaseID] = SelectedPhase )
RETURN
    IF ( CurrentMemo IN SelectedMemos, 1 )

This is amazing. thank you so much 🙂 

tamerj1
Super User
Super User

Hi @Aperszon 

how does the source data look like? Is it one table? What is [Count]? Is it a column or a measure?

@tamerj1 

The source data sits in 2 other tables.

 

see below link for an extract of the source data and how it is sructured

and count is currently a column in the table, used for structuring my source data to the correct location. not necessarily needed for this retrieval (I think).

 

https://docs.google.com/spreadsheets/d/1CL8DFNMPORLDx7BG2u61z4_8PwxjLbXO/edit?usp=sharing&ouid=10955...

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.

Top Solution Authors