cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bdehning
Post Prodigy
Post Prodigy

Column Chart Percent Rounding Issue

I use the following measure to compute % of things that occur each day of week for 5 years on a clustered column chart.  Sometimes the % for a year may total 101% for example.   

 

Can I add something to the measure to make sure each year the percentages equal 100%? 

 

Share Count Test =
VAR _count =
    COUNT'LossRunToExcel'[Total Gross Incurred] )
VAR _totalperyear =
    CALCULATE (
        COUNT'LossRunToExcel'[Total Gross Incurred]),
        FILTER (
            ALLSELECTED ( 'LossRunToExcel'),
            [Policy Inception Year] = MAX ( 'LossRunToExcel'[Policy Inception Year])
               
        )
    )
RETURN
    DIVIDE ( _count_totalperyear )
2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with, explain the question and show the expected result.  Please also ensure that you have a Calendar Table with a column of Week number.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FreemanZ
Community Champion
Community Champion

hi @bdehning 

Not sure about the logic, if limit to result to 100% is the only issue, you may try to change 

RETURN

DIVIDE ( _count, _totalperyear )

to

VAR _pct = 

DIVIDE ( _count, _totalperyear )

RETURN

IF(_pct<=1, _pct, 1)

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors