Forum Discussion
Jyaul1122
10 months agoHelper III
Many to Many Measures
Hello, I have two tables Status and Address in relation with many to many via Project (status) and Project(address) column. I would like to get status of Project from Status table based o...
- 10 months ago
Hi Jyaul1122 ,
Thanks for reaching out to Microsoft Fabric Community.
I tested the scenario using the same sample data shared above.
Since TREATAS was causing performance issues in your model, here's an alternative approach using FILTER and IN, which avoids TREATAS and performs better in heavier models.
Here's the measure:
Status by Month = VAR SelMonth = SELECTEDVALUE('Status'[Month]) RETURN CALCULATE ( MAX('Status'[Status]), FILTER ( ALL('Status'), 'Status'[Month] = SelMonth && 'Status'[Project] IN VALUES('Address'[Project]) ) )Please find attached .pbix for reference and reach out for any further assistance.
Thank you.Thanks rohit1991 , mdaatifraza5556 and BernardBonto for your valuable inputs.
mdaatifraza5556
10 months agoSuper User
Hi Jyaul1122
Could you please try the below dax to create the dax ?
Selected Status =
VAR SelectedMonth = SELECTEDVALUE('Status'[Month])
VAR ThisProject = SELECTEDVALUE('Address'[Project(Address)])
RETURN
CALCULATE(
MAX('Status'[Status]),
FILTER(
'Status',
'Status'[Project(Status)] = ThisProject &&
'Status'[Month] = SelectedMonth
)
)
If this answers your questions, kindly accept it as a solution and give kudos.
Also attached the pbix file for you reference.
If this answers your questions, kindly accept it as a solution and give kudos.
- Jyaul112210 months agoHelper III