Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Substract first month value from rest all months

 

Hello Friends,

 

I am struggle to get logic. Month & Sales

JanFebMarAprMayJunJulAugSepDec
212535456569708087100

My requirement is

 

A= 21(Jan)

B=100(Dec)

([Sales]-A)/(B-A)

The result should be

JanFebMarAprMayJunJulAugSepDec
0(25-21)/(100-21)=0.****(35-21)/(100-21)=0.****456569708087100

Kindly help me on solution

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@Anonymous  if you have a table like this

 

monthvalue
jan21
feb25
march35
apr45
may65
june69
july70
aug80
sep87
oct90
nov92
dec100

 

and the final fraction to follow the following logic

A= 21(Jan)

B=100(Dec)

([Sales]-A)/(B-A)

 

You can reach what you need by using following measures

 

Sales:= SUMX(X,X[value])

only jan sales (A) := CALCULATE([Sales],ALL(X),X[month]="jan")

only dec sales (B):= CALCULATE([Sales],ALL(X),X[month]="dec")

Numerator (Sales-A):= [Sales]-[only jan sales (A)]

Denominator (B-A):= [only dec sales (B)]-[only jan sales (A)]

Fraction:= [Numerator (Sales-A)]/[Denominator (B-A)]

 

 

swqa.PNG

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

4 REPLIES 4
smpa01
Super User
Super User

@Anonymous  if you have a table like this

 

monthvalue
jan21
feb25
march35
apr45
may65
june69
july70
aug80
sep87
oct90
nov92
dec100

 

and the final fraction to follow the following logic

A= 21(Jan)

B=100(Dec)

([Sales]-A)/(B-A)

 

You can reach what you need by using following measures

 

Sales:= SUMX(X,X[value])

only jan sales (A) := CALCULATE([Sales],ALL(X),X[month]="jan")

only dec sales (B):= CALCULATE([Sales],ALL(X),X[month]="dec")

Numerator (Sales-A):= [Sales]-[only jan sales (A)]

Denominator (B-A):= [only dec sales (B)]-[only jan sales (A)]

Fraction:= [Numerator (Sales-A)]/[Denominator (B-A)]

 

 

swqa.PNG

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

Super,

Works for me.

Thank you for your quick help and support.

 

Regards,

 

Babu

Anonymous
Not applicable

Hi @Anonymous ,

 

IF your data is really organized in the way it is shown (it seems unlikely), so a column for Jan, another column for Feb and so on, 

Then you can just add columns to your table with the calculation as you described.

 

For instance for FEB : Calc Feb = Divide((sum(Data[Feb]) - Sum(Data[Jan])),sum(data[dec])-sum(Data[Jan]))
 
2020-02-08 19_48_42-Window.png
 
Otherwise it is better to show how your data is organized, and also why Sep and Oct are missing.
 
Jan 
Anonymous
Not applicable

Dear JustJan,

 

Sorry for not elobarate requirement to you, but smpa01 solution working for me.

 

thank you for your quick response.

 

Regards,

 

Babu

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors