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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PeterL2907
Regular Visitor

How to divide a measure by total of that measure

Hi,

 

I have a visual that uses a measure "Prod" by month

The visual automatically calculates the total of that measure.

Now i want to divide every month by that total.

PeterL2907_0-1722156503285.png

 


I tried to solve it with a new measure using:
Measure1 = TotalYTD('Table'[Prod], 'Table'[Date])

And then another measue:

Measure2 = [Prod] /  [Measure1]

If i use measure1 in a new visual with only OT and Measure2 it gives the right result.

PeterL2907_1-1722156502619.png

 

But the division gives 100% on everything.

So in the new visual it should give:

"Antwerpen Bus"" for "januari = 64,75% / 64,58% So it should show 100,26% 

1 ACCEPTED SOLUTION

@PeterL2907,

 

Try this measure:

 

Percent of LY Total =
DIVIDE (
    [Prod],
    CALCULATE (
        [Prod],
        ALL ( 'Date' ),
        'Date'[Year] = SELECTEDVALUE ( 'Date'[Year] ) - 1
    )
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
DataInsights
Super User
Super User

@PeterL2907,

 

Try a measure like this that clears the month filter context while keeping the year filter context. Does your model have a date table? Date calculations and filtering are more robust with a date table.

 

Percent of Total =
DIVIDE ( [Prod], CALCULATE ( [Prod], ALL ( 'Date' ), VALUES ( 'Date'[Year] ) ) )

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This seems to do the trick. Thank you.

I have 1 additional question.

Now I divide the month by the total of the same year, how would i do it if I wanted to divide it by the past year total?

@PeterL2907,

 

Try this measure:

 

Percent of LY Total =
DIVIDE (
    [Prod],
    CALCULATE (
        [Prod],
        ALL ( 'Date' ),
        'Date'[Year] = SELECTEDVALUE ( 'Date'[Year] ) - 1
    )
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors