Forum Discussion
How to get answer for question, How many Tags per resource I have?
- Anonymous10 months ago
Hi jaryszek,
Thank you for reaching out to the Microsoft fabric community forum.
The main reason you are getting a constant value is that the filter from the Tag table is not reaching the bridge table in your actual model. Because of this, Power BI is counting all resources every time, instead of only the resources for the selected tag. That’s why your SQL query shows different counts, but the DAX measure gives the same number.
In your sample Product Tag model it works because the relationships allow the filter to flow correctly. But in your real model the filter direction is blocking it.
You can fix this by Turning on bidirectional filter on the relationship used for this calculation or Using a DAX measure that forces the filter to pass through.
After this, the DISTINCTCOUNT will respond correctly for each tag.
Hope the above provided information help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.
Regards,
Coummunity support Team.
jaryszek , measure should not be created be Dim level. It has created at fact level
New_Resources Count =
Countrows( Summarize(Fact, 'Dim_EA_Resource_Bridge_Tags'[DateResourceIdKey] ) )
. Make sure you have bi-direction join between the resource and Amortized Cost
And futhermore,
I am trying to use best practices design from this topic:
https://community.fabric.microsoft.com/t5/Desktop/How-to-get-costs-for-Specific-Group-within-Bridge-Model-Design/m-p/4882982#M1447471
to not use bidrectional relationships everywhere.
Best,
Jacek
- Anonymous10 months agoNot applicable
Hi jaryszek,
Thank you for reaching out to the Microsoft fabric community forum.
The main reason you are getting a constant value is that the filter from the Tag table is not reaching the bridge table in your actual model. Because of this, Power BI is counting all resources every time, instead of only the resources for the selected tag. That’s why your SQL query shows different counts, but the DAX measure gives the same number.
In your sample Product Tag model it works because the relationships allow the filter to flow correctly. But in your real model the filter direction is blocking it.
You can fix this by Turning on bidirectional filter on the relationship used for this calculation or Using a DAX measure that forces the filter to pass through.
After this, the DISTINCTCOUNT will respond correctly for each tag.
Hope the above provided information help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.
Regards,
Coummunity support Team.