cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jansenuy Regular Visitor
Regular Visitor

Calculating percentage change for scroller custom visual

So, I tried using the custom visual scroller and I wanted to have a deviation column but I am running into a problem.

 

So I already have my absolute measure (numbers) and category (division of those numbers) filled in. The problem is, there are a lot of rows that would correspond to the samec category like this for example

 

1  CatA

2  CatB

3  CatA

5  CatC

2  CatC

1  Cat A

2  Cat A

 

Unlike the examples online where:

 

1  CatA 2%

and so on

 

I have to add all CatAs first before getting percentage change. I came up with this measure but it reflect +Infinity to all my percentage change. FFE is like sales.

 

 

FFE Change Weekly = 
CALCULATE(sum('Master Data'[FFE]),
FILTER('Master Data', 'Master Data'[Week Num]=(WEEKNUM(TODAY())-1)||'Master Data'[ATF Port Dep 1 Year]="2017")) /
CALCULATE(sum('Master Data'[FFE]),FILTER('Master Data','Master Data'[Week Num]=(WEEKNUM(TODAY())-2)||'Master Data'[ATF Port Dep 1 Year]="2016"))-1

 

Hope you can help me with this. I don't know how to individually assign % change to each direction.

 

Thanks.

 

1 REPLY 1
Microsoft Eric_Zhang
Microsoft

Re: Calculating percentage change for scroller custom visual

@jansenuy

It looks like a context issue, could you try

 

FFE Change Weekly =
CALCULATE (
    SUM ( 'Master Data'[FFE] ),
    FILTER (
        ALL ( 'Master Data' ),
        'Master Data'[Week Num]
            = ( WEEKNUM ( TODAY () ) - 1 )
            || 'Master Data'[ATF Port Dep 1 Year] = "2017"
    )
)
    / CALCULATE (
        SUM ( 'Master Data'[FFE] ),
        FILTER (
            ALL ( 'Master Data' ),
            'Master Data'[Week Num]
                = ( WEEKNUM ( TODAY () ) - 2 )
                || 'Master Data'[ATF Port Dep 1 Year] = "2016"
        )
    )
    - 1

 

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors