Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Alibek24
Regular Visitor

MAX value of running total

Hello everyone!

 

I think I need some help in measure calculation. I have a matrix:

2019_04_09_16_20_41_Management_Reporting_New_for_External_Power_BI_Desktop.png

 

 

 

 

 

 

 

 

 

 

 

 

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:

  1. Total outcomes for March - 264 080 000
  2. Income% for 0th week: 134 235 417.39 / 264 080 000 = 50.8%
  3. Income% for 1st week: 197 121 636.12 / 264 080 000 = 74.6%
  4. Income% for 1st week: 203 048 547.52/ 264 080 000 = 76.9%

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?

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

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])
	)
)

View solution in original post

Anonymous
Not applicable

@Alibek24  - 

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])
        )
    )
)

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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])
	)
)
Anonymous
Not applicable

@Alibek24  - 

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:

@Alibek24  - 

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?

2019_04_09_18_12_01_Management_Reporting_New_for_External_Power_BI_Desktop.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.