Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone!
I think I need some help in measure calculation. I have a matrix:
rows are weeks, and columns are dates. I have some incomes for each week, and I wanted to calculate % of the outcome at a particular month. Let's say for March:
I tried to calculate the total outcome as a max of running total but can not find any solutions.
Are there any bits of advice?
Solved! Go to Solution.
Hi @Alibek24 -
The percentage would be someting like the following.
Notes:
-Substitute [Payment Amount] with the measure you want to total.
-Substitute 'Weeks Table'[Weeks Column] with the column that defines sequence in the running total.
Running Total Percent of Total = var week_number = MAX('Weeks Table'[Weeks Column]) DIVIDE( CALCULATE( [Payment Amount], 'Weeks Table'[Weeks Column] <= week_number ), CALCULATE( [Payment Amount], ALL('Weeks Table'[Weeks Column]) ) )
You could check the current value like this:
Running Total Percent of Total =
var week_number = MAX('Weeks Table'[Weeks Column])
IF(
ISBLANK([Payment Amount]),
BLANK(),
DIVIDE(
CALCULATE(
[Payment Amount],
'Weeks Table'[Weeks Column] <= week_number
),
CALCULATE(
[Payment Amount],
ALL('Weeks Table'[Weeks Column])
)
)
)
Hi @Alibek24 -
The percentage would be someting like the following.
Notes:
-Substitute [Payment Amount] with the measure you want to total.
-Substitute 'Weeks Table'[Weeks Column] with the column that defines sequence in the running total.
Running Total Percent of Total = var week_number = MAX('Weeks Table'[Weeks Column]) DIVIDE( CALCULATE( [Payment Amount], 'Weeks Table'[Weeks Column] <= week_number ), CALCULATE( [Payment Amount], ALL('Weeks Table'[Weeks Column]) ) )
You could check the current value like this:
Running Total Percent of Total =
var week_number = MAX('Weeks Table'[Weeks Column])
IF(
ISBLANK([Payment Amount]),
BLANK(),
DIVIDE(
CALCULATE(
[Payment Amount],
'Weeks Table'[Weeks Column] <= week_number
),
CALCULATE(
[Payment Amount],
ALL('Weeks Table'[Weeks Column])
)
)
)
@Anonymous wrote:You could check the current value like this:
Running Total Percent of Total =
var week_number = MAX('Weeks Table'[Weeks Column])
IF(
ISBLANK([Payment Amount]),
BLANK(),
DIVIDE(
CALCULATE(
[Payment Amount],
'Weeks Table'[Weeks Column] <= week_number
),
CALCULATE(
[Payment Amount],
ALL('Weeks Table'[Weeks Column])
)
)
)
@Anonymous thanks a lot! Everything works as needed
Thanks a lot, it worked with return after var declaring.
I have one small issue: how to get rid of other percents?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |