The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
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.
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%
Solved! Go to Solution.
Try this measure:
Percent of LY Total =
DIVIDE (
[Prod],
CALCULATE (
[Prod],
ALL ( 'Date' ),
'Date'[Year] = SELECTEDVALUE ( 'Date'[Year] ) - 1
)
)
Proud to be a Super User!
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] ) ) )
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?
Try this measure:
Percent of LY Total =
DIVIDE (
[Prod],
CALCULATE (
[Prod],
ALL ( 'Date' ),
'Date'[Year] = SELECTEDVALUE ( 'Date'[Year] ) - 1
)
)
Proud to be a Super User!