This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello!! How are they? I hope well.
I wanted to know if you can help me with a case where I do not understand where the problem would be, I pass the context:
I have a table called Tons, which has the columns:
Id: is the customer number
Date: date of registration
Financial year: number of the accounting year
Ton: quantity of tons
I need to get the tons per exercise of each client (id), the participation of the client in each exercise and finally the average of the last 5 exercises of a client.
For all this create the following measures:
To calculate the sum of tonnes for a specific customer in a specific accounting year:
Tn Client = CALCULATE (
SUM(tonnes[tonnes]),
ALL(tonnes),
Tons[Id] = SELECTEDVALUE(Tons[Id]),
VALUES(tonnes[exercise])
)
To calculate the sum of tonnes for a specific accounting year in all rows of the "Tonnes" table:
Tn Exercise = CALCULATE (
SUM(tonnes[tonnes]),
ALL(tonnes),
VALUES(tonnes[exercise])
)
To calculate a customer's engagement:
participation = [Tn Client]/ [Tn Exercise]
Finally to get the average participation of the last 5 exercises, I made the following measurement:
In the example I chose the id 2553 and the average participation of the last 5 exercises is 22.78.
I do not understand where the error is in my measurements so that it does not give me the correct value.
Please could you help me???
Thanks a lot.
Hi Admin! Could you pass me the untranslated formula? Because I don't understand it. Thank you.
@Syndicate_Admin , Have separate table with values exercise
an try like
New measure =
var _max = MAX(exercise[exercise])
var _min =_max-4
RETURN
calculate(
AverageX(summarize(tonnes,Tons[Id]) CALCULATE (SUM(tonnes[tonnes]) )), filter( all(exercise), exercise[exercise] >=_min && exercise[exercise] <=_min))
Consider window function if needed
Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 23 | |
| 22 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 60 | |
| 35 | |
| 28 | |
| 22 | |
| 21 |