Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm filtering table Person ID with the Field of business dimensional table. If one specific field (for example Field 1) is selected we want to filter every person ID on every company. But in case the selection is "Similar" we should only get a list of person ID's who belong to any company that is similar for the selected company.
I wonder if there is a way to build a measure that activates the inactive relation between Company 2 and Person ID whenever "Similar" is selected.
Thanks in advance!
Julia
Solved! Go to Solution.
You could write a measure with two variables - one with USERELATIONSHIP and one without, and then use IF with SELECTEDVALUE on your slicer column to decide which to return.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @Anonymous ,
According to your description, I create a sample, the measure is just like you wrote.
When I drag it into the values, and select “similar”, it can work fine like other fields.
Here’s my sample bellow.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-yanjiang-msft! Your answer made me realize my model wasn't following exactly the picture attached. After making some relation changes the report started to work as I had hoped. Thanks for making such a huge effort 🙂
Thanks, your solution moved me forward but I still need some additional guidance. This is how my measure worked out:
Measure =
var _similar = CALCULATE(DISTINCTCOUNT('PERSON ID'[id]), USERELATIONSHIP(PERSON ID[id], Company2[Id]))
var _all = CALCULATE(DISTINCTCOUNT('PERSON ID[id])
RETURN
CALCULATE(IF(SELECTEDVALUE(Field of Business[key]) = "Similar", _similar, _all))
The problem is, I only get the calculated amount of similar id's but it is not possible to use them as row values. In the Person ID table I have additional information, such as gender. I'd like to visualize how id's within each and every selection are divided into men and women.
When I select any other field than "Similar", the column chart works perfectly. When selecting "Similar", the visualization is turning all white.
Do you have an idea how this could be fixed?
Does anybody have an idea how to fix this? 🙂
You could write a measure with two variables - one with USERELATIONSHIP and one without, and then use IF with SELECTEDVALUE on your slicer column to decide which to return.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
22 | |
10 | |
10 | |
9 | |
7 |