The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Very simple data model and report here to demonstrate my issue. I have a Person table and a City table with a one-to-many relationship on CityID as shown below. I entered the data manually.
I've added MyMeasure to the Person table that just returns a constant value.
My report has a slicer on Name, and two table visuals to illustrate the issue.
Table1 - Without MyMeasure in the table, it works as expected. It shows the selected user name with their city name.
Table2 - Whenever I add MyMeasure to the table, it ignores the relationship and returns the selected user associated with ALL cities.
What is the simplest modification I can make here to correct the issue? Thank you.
Solved! Go to Solution.
@bvy Maybe:
MyMeasure =
VAR __CityID = MAX('Person'[CityID])
VAR __CityID2 = MAX('City'[CityID])
RETURN
IF(__CityID = __CityID2, "Active",BLANK())
As for why, it is because you coded your measure as a constant. So every row will return that constant value for your measure and thus your current results.
@bvy Maybe:
MyMeasure =
VAR __CityID = MAX('Person'[CityID])
VAR __CityID2 = MAX('City'[CityID])
RETURN
IF(__CityID = __CityID2, "Active",BLANK())
As for why, it is because you coded your measure as a constant. So every row will return that constant value for your measure and thus your current results.
Hi @Greg_Deckler and thanks for taking time to look at this with me...
I see where you're heading with this, but your proposed change doesn't work. I've tried some variations also, and they don't work either. See below...
@bvy Likely incorrect configuration of the visual or a difference in relationships. City should come from the City table and Name from the Person table. Take a look at the PBIX attached below signature, working great there.
You were right. I had changed the relationsship to two way and forgot to send it back. Appreciate the help.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
82 | |
63 | |
53 | |
51 |
User | Count |
---|---|
127 | |
118 | |
81 | |
65 | |
64 |