Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Guys,
I have to perform a calculation, which I don't know how to solve. The following model is a mini example of my real problem. I have 3 tables with DirectQuery:
Table 1
Table 2
Table 3
I need to know the total monthly amount that each of the Offices has, the formula is:
Monthly Amount = SUM (Clients [Payment] / Frequency [Months])
The final result should be:
Office 1 = 70
Office 2 = 200
Thanks for the help,
Solved! Go to Solution.
Hi @jjovega
Due to the filter([Office ID] = Max([Office ID])) in measre, the original measure will show max Office ID's Monthly Amount in Total. I update the measure, please try this measure.
Monthly Amount =
VAR _Result =
SUMX (
SUMMARIZE (
Office,
Office[Office ID],
Office[Office Name],
"Monthly Amount",
VAR _T =
SUMMARIZE (
Clients,
Clients[ID],
Clients[Office ID],
"Divide", DIVIDE ( SUM ( Clients[Payment] ), SUM ( Frequency[Month] ) )
)
RETURN
SUMX ( FILTER ( _T, Clients[Office ID] = MAX ( Office[Office ID] ) ), [Divide] )
),
[Monthly Amount]
)
RETURN
_Result
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jjovega
You may relate Table1 and Table2 by [Frequency ID] column and relate Table2 and Table3 by [Office ID] column. I think there may be someting wrong in [Office ID] in Table2.
From your Statement:
Monthly Amount (Office1) = 120/6 + 600/12 = 70
Monthly Amount (Office2) = 200/1 = 200.
So Tim should in Office1 and Luis should in Office2.
Measure:
Monthly Amount =
VAR _T = SUMMARIZE(Clients,Clients[ID],Clients[Office ID],"Divide",DIVIDE(SUM(Clients[Payment]),SUM(Frequency[Month])))
Return
SUMX(FILTER(_T,Clients[Office ID] = MAX(Office[Office ID])),[Divide])
Result:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, @v-rzhou-msft, for the answer, it is exactly what I am looking for. Thanks for the support.
Now I have a question about the total amount of Monthy Amount, since the total sum of the 2 Offices should be 270 and the total in your image is 200.
The same thing has happened to me by totaling "Measure", which does not always total the correct amount. Will you know how to solve this problem?
This is another example I have:
I really appreciate your comments
Hi @jjovega
Due to the filter([Office ID] = Max([Office ID])) in measre, the original measure will show max Office ID's Monthly Amount in Total. I update the measure, please try this measure.
Monthly Amount =
VAR _Result =
SUMX (
SUMMARIZE (
Office,
Office[Office ID],
Office[Office Name],
"Monthly Amount",
VAR _T =
SUMMARIZE (
Clients,
Clients[ID],
Clients[Office ID],
"Divide", DIVIDE ( SUM ( Clients[Payment] ), SUM ( Frequency[Month] ) )
)
RETURN
SUMX ( FILTER ( _T, Clients[Office ID] = MAX ( Office[Office ID] ) ), [Divide] )
),
[Monthly Amount]
)
RETURN
_Result
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
85 | |
81 | |
66 | |
62 | |
53 |
User | Count |
---|---|
120 | |
99 | |
91 | |
83 | |
65 |