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
bilingual
Helper V
Helper V

Percentage difference from filtered value - fixed measure based on Week for multiple variables?

Hi everybody, i want to create an index of my data where it will show the number of transcations compared to week 10/2020, so far so good i have created this Measure which works fine: 
 
Title =
VAR __BASELINE_VALUE = CALCULATE(SUM('Data_akk'[Number of transactions]); 'Data_akk'[Weeknr] IN { 10 })
VAR __MEASURE_VALUE = SUM('Data_akk'[Number of transactions])
RETURN
    IF(
        NOT ISBLANK(__MEASURE_VALUE);
        DIVIDE(__MEASURE_VALUE - __BASELINE_VALUE; __BASELINE_VALUE)
    )
 
One question: 
1. If i want to make more variables show the percentage difference, can i do so without creating this measure for each?
 
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@bilingual , I doubt you have to create measures like this.

View solution in original post

Hi @bilingual ,

 

You do need to create measures for different weeks, unless you want the following, then you can use the slicer to change the weeks.

Measure 8 = 
VAR x = 
CALCULATE(
    SUM(Sheet3[Trans]),
    ALLEXCEPT(Sheet3, Sheet3[Week])
)
VAR y = 
CALCULATE(
    SUM(Sheet3[Trans]),
    ALL(Sheet3)
)
RETURN
DIVIDE(
    y-x,
    x,
    BLANK()
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@bilingual , I doubt you have to create measures like this.

So please enlighten me a better practice , i am an novice 🙂

Hi @bilingual ,

 

Please give me a sample data of 'Data_akk' table?

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lionel, here it comes how data in Data_Akk is placed :

 

From this data i would like to create a dynamic Index from Week 10 2020, so i do not need to create one for each variable.

 

 

DateWeekTransactionsRemindersAmmountEmails
02-04-20201445545541500000700
03-04-20201421313222000044800
04-04-20201454846457400000900

Hi @bilingual ,

 

You do need to create measures for different weeks, unless you want the following, then you can use the slicer to change the weeks.

Measure 8 = 
VAR x = 
CALCULATE(
    SUM(Sheet3[Trans]),
    ALLEXCEPT(Sheet3, Sheet3[Week])
)
VAR y = 
CALCULATE(
    SUM(Sheet3[Trans]),
    ALL(Sheet3)
)
RETURN
DIVIDE(
    y-x,
    x,
    BLANK()
)

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.