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
Anonymous
Not applicable

Difference between two columns and finding the sum of variance

Hi All,

 

I'm going to break my issue into two steps:

1. July being the first month of Fiscal year. I need to find the difference between value every month with July:

Eg: Month           Value          Difference

      July                  10              0

      Aug                  30              20

      Sep                   20             10

       Oct                  10              0

 

Something like above.

 

2. My second step is to find the sum of the difference column above.

Sum= 0+20+10+0=30

 

Any help would be appreciated.

Thanks in Advance.

Bhavya

1 ACCEPTED SOLUTION

hello @Anonymous

 

 

try something like this and let me know if it works for yout scenario:

 

Distribution Difference = 

SUMX(
    SUMMARIZE( 'Calendar', 'Calendar'[Year], 'Calendar'[Year Month] ),
    CALCULATE( SUM( Distributions[Distribution] ) ) - 
    CALCULATE( 
        SUM( Distributions[Distribution] ), 
        STARTOFYEAR( 'Calendar'[Date], "06/30") 
    )
)

 

 

 

 

2018-12-10_12-24-15.jpg2018-12-10_12-23-53.jpg2018-12-10_12-23-36.jpg2018-12-10_12-23-21.jpg

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

6 REPLIES 6
LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous

 

are you able to post a sample of your data? is it aggregated by month?

 

 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Hi,

 

Thanks for your response. Below is how my data looks:

First I need to find the difference between each month data and July data and then find the sum of that difference to show it in another table.

 

YearMonthDistribution
Jul-18172406
Aug-18168617
Sep-18168061
Oct-18145094
Nov-1898080

Hello @Anonymous

 

are you looking to create a new calculated table with the data or in a matrix ?

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

In a Matrix table. 

hello @Anonymous

 

 

try something like this and let me know if it works for yout scenario:

 

Distribution Difference = 

SUMX(
    SUMMARIZE( 'Calendar', 'Calendar'[Year], 'Calendar'[Year Month] ),
    CALCULATE( SUM( Distributions[Distribution] ) ) - 
    CALCULATE( 
        SUM( Distributions[Distribution] ), 
        STARTOFYEAR( 'Calendar'[Date], "06/30") 
    )
)

 

 

 

 

2018-12-10_12-24-15.jpg2018-12-10_12-23-53.jpg2018-12-10_12-23-36.jpg2018-12-10_12-23-21.jpg

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

Thank You @LivioLanzo. Below formula worked for me. Something similar to what you have mentioned.

 

Distribution sku difference from JUL-2018 =
VAR __BASELINE_VALUE =
    CALCULATE(
        [Distribution sku Latest],
        'DIM_DATE'[YearMonth] IN { "JUL-2018" },
        ALL('DIM_DATE'[fiscalmonth])
    )
VAR __MEASURE_VALUE = [Distribution sku Latest]
RETURN
    if(max(DIM_DATE[YearMonth]) = "JUL-2018",[Distribution sku Latest],IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE))

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.