Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Good afternoon,
I would like to ask for help and understanding on the relationship between slicers and measures.
I have two tables, AE and DM, linked by a 1-to-many (DM is 1 and AE is many), bidirectional relationship on a column called URCFID.
I also have the following calculated column in DM:
Incidence Rate =
COALESCE(
DIVIDE(COUNTROWS(RELATEDTABLE(AE)), [Duration (months)]),
0
)Solved! Go to Solution.
For anyone facing the same problem, here is the solution I found: use a measure instead of a calculated column.
Since I was ultimately only interested in the average of the column, I created a new measure as such:
Average Incidence Rate =
AVERAGEX(
DM,
COALESCE(
DIVIDE(COUNTROWS(RELATEDTABLE(AE)), [Duration (months)]),
0
)
)
My best guess (which I haven't been able to find a reference for in the documentation) is that calculated columns (and calculated tables) are probably pre-calculated before any visual filters are applied to the model. Therefore what I was getting earlier was that
COUNTROWS(RELATED(AE))was happening before the AE table was filtered by the visual, and the results therefore stayed constant.
Measures, on the other hand, are likely calculated as the last step in the process, and hence happen after the tables are filtered by the visual filters.
I hope this helps someone else. Good luck!
For anyone facing the same problem, here is the solution I found: use a measure instead of a calculated column.
Since I was ultimately only interested in the average of the column, I created a new measure as such:
Average Incidence Rate =
AVERAGEX(
DM,
COALESCE(
DIVIDE(COUNTROWS(RELATEDTABLE(AE)), [Duration (months)]),
0
)
)
My best guess (which I haven't been able to find a reference for in the documentation) is that calculated columns (and calculated tables) are probably pre-calculated before any visual filters are applied to the model. Therefore what I was getting earlier was that
COUNTROWS(RELATED(AE))was happening before the AE table was filtered by the visual, and the results therefore stayed constant.
Measures, on the other hand, are likely calculated as the last step in the process, and hence happen after the tables are filtered by the visual filters.
I hope this helps someone else. Good luck!
The standard setup is a Star Schema with a Dimension Table controlling a Fact table in a single direction. Your setup varies substantially from that.
A measure is recalculated if the user interacts with a slicer, the measure depends on that value, and the measure is included in a visual.
Good morning!
I don't understand why you say my setup varies from that. I have a star schema with DM at the center. DM is related to AE via a uni-directional filter.
When using a slicer, the measure gets updated. Just not in the right way.
I am not sure that I understand your answer.
Any clarification would be helpful to learn more 🙂
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |