March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I'm trying to calculate a simple indicator by dividing one value by another. Consider the following tables:
The first one is the total amount of people in the health plan, per month. The second one is a measure, a filtered value of two certain types of medical apointments, also per month. The third column should simply divide the second table values by the first one. The grand totals are for 36 months, but only four are visible due to cropping.
Now is the weird thing: the division result for the grand totals is right. Only the division by month is distorted, as you can see calculating 201803 for example: 2408/5795 = 0,41.
I don't know what is happenning. For reference here are the DAX queries I'm using to divide the values:
Total Appointments = Var Filter = FILTER('Events';'Events'[Type]="Appointment" && 'Events'[Procedure]="1" || 'Events'[Procedure]="2") Return COUNTROWS(Filter)
Indicator = DIVIDE('Measures'[Total Appointments];COUNT('Users'[ID]))
Thanks in advance!
Solved! Go to Solution.
Hello, and sorry for the late reply.
Indeed, it was a relationship problem.
For anyone coming to this post in the future: check for disabled relationships whenever your measures are not returning the correct calculations.
In my case, I was trying to link tables in a relationship that would result in a circular reference, so it automatically disabled it.
Hi @coriben,
Is the date field from a separate date dimention table? If not, which table does it belong to?
Please try this:
Total User =
CALCULATE ( COUNT ( 'Users'[ID] ), ALLEXCEPT ( 'Date', 'Date'[dates] ) )
Indicator = DIVIDE('Measures'[Total Appointments],[Total User])
Besides, please post some dummy data of source table (not the calculated values from visual) and make the relationship between each table more clear.
Regards,
Yuliana Gu
Hello @v-yulgu-msft, thanks for your response!
Is the date field from a separate date dimention table? If not, which table does it belong to?
No, it's both in the "Events" and in the "Users" tables, in this case I'm using the date in the Events table, but using the one in the Users table does not work also. I've tried to create a Dates table, but it didn't work as well.
Please try this:
Tried, same result as the screenshot.
Besides, please post some dummy data of source table (not the calculated values from visual)...
Sorry, could not follow you here. How do I do that? What do you mean by calculated values from visual?
[...] make the relationship between each table more clear.
All events in the "Events" table have a "User ID" that is linked with a both ways one to many relationship with the "Users" table User ID.
Thanks a lot for your help so far!
Hello, and sorry for the late reply.
Indeed, it was a relationship problem.
For anyone coming to this post in the future: check for disabled relationships whenever your measures are not returning the correct calculations.
In my case, I was trying to link tables in a relationship that would result in a circular reference, so it automatically disabled it.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
91 | |
74 | |
59 | |
53 |
User | Count |
---|---|
196 | |
115 | |
107 | |
66 | |
63 |