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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ygangadhara
New Member

Formulas two apply on Row Level

I'm hoping I can get a bit of help. I have data in two Rows need to calculate 3 rd row as mentioned below.

 

Value 1 & Value 2 are given 

Need to calculate Value3 = Value2/ Value1*100 for all the months.

 

 JanFeb
1. Value11012
2. Value223
3. Value32025

 

Any help would be greatly apprecaited. 

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @ygangadhara 

You can refer to the following example

Sample data

vxinruzhumsft_0-1678415217278.png

And I put the fields to the matrix visual, and create a measure as value to put in matrix

 

 

Measure = var a=CALCULATE(SUM('Table'[Value]),OFFSET(-1,,ORDERBY('Table'[ValueType]),KEEP))
var b=CALCULATE(SUM('Table'[Value]),OFFSET(-2,,ORDERBY('Table'[ValueType]),KEEP))
return IF(SUM('Table'[Value])=BLANK(),DIVIDE(a,b)*100,SUM('Table'[Value]))

 

 

Output

vxinruzhumsft_1-1678415312921.png

 

Best Regards!

Yolo Zhu

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

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @ygangadhara 

You can refer to the following example

Sample data

vxinruzhumsft_0-1678415217278.png

And I put the fields to the matrix visual, and create a measure as value to put in matrix

 

 

Measure = var a=CALCULATE(SUM('Table'[Value]),OFFSET(-1,,ORDERBY('Table'[ValueType]),KEEP))
var b=CALCULATE(SUM('Table'[Value]),OFFSET(-2,,ORDERBY('Table'[ValueType]),KEEP))
return IF(SUM('Table'[Value])=BLANK(),DIVIDE(a,b)*100,SUM('Table'[Value]))

 

 

Output

vxinruzhumsft_1-1678415312921.png

 

Best Regards!

Yolo Zhu

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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