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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

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

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.