Forum Discussion
Multiple USERELATIONSHIPS functions within an AND and within a CALCULATE
- 1 year ago
D_PBI - You need to take the USERELATIONSHIP filters out of the FILTER statement, and add them as additional filters.
Also, I would not recomment using FILTER( 'Table', 'column' ) as you have, this is a classic anti pattern and will result in a slower calculation, you should filter a column rather than a table. Here is a good article for this: https://www.sqlbi.com/articles/filter-columns-not-tables-in-dax/
One final thing, I would recommend simplfying your final condition to use NOT IN {"Value1", "Value2" } etc.
I hope this helps, if you need more please provide the DAX code outside of a screenshot and some sample data.
If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!
- 1 year ago
Hi D_PBI,
I wanted to check if you had the opportunity to follow up on our previous conversation. If yes can you please provide the sample data so that we can provide you with the accurate and correct solution.
Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.
v-sgandrathi thanks for your efforts. They're appreciated. However, the 'Test_Licences' measure you've created isn't following the logic in my measure, the logic I need.
Your logic is creating a seperate table per date filter. This will return a greater number of records and there is less filtering applied in one go. My measure, my logic, applies all the date filtering in one go and so only the records that match that criteria will be returned. As more filters are applied, the number of records returned will be less.
The trouble I'm facing is being to use the USERELATIONSHIP functions multiple times within the same filter. In my DAX measure example above, you will see two parts to the measure, separated by an || (OR). The top half of the measure uses several USERELATIONSHIP functions - this is not working. In the bottom half of the measure, it uses only a single USERELATIONSHIP function but even still it's not working.
For some reason the USERELATIONSHIP isn't working at all and I don't understand why.
- v-sgandrathi1 year ago
Community Support
Hi D_PBI,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
How to provide sample data in the Power BI Forum - Microsoft Fabric CommunityThank you.
- v-sgandrathi1 year ago
Community Support
Hi D_PBI,
I wanted to check if you had the opportunity to follow up on our previous conversation. If yes can you please provide the sample data so that we can provide you with the accurate and correct solution.
Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.
- v-sgandrathi1 year ago
Community Support
Hi D_PBI,
We strive to make sure every issue gets addressed completely. If the previous answer helped, that’s great, please mark it as Accepted and consider giving it a Kudos.
Still facing issues? Just reply here and we’ll be right with you.
Thanks for being a valued part of the community,