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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.