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
jansenuy
Helper I
Helper I

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
Eric_Zhang
Employee
Employee

@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
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.