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

how to get difference from plan vs actual in power bi

Hi Everyone,

Greetings!

 

Thank you in advance.

 

I am new to Power BI, i have created one P&L report.

 

i want to take difference in % from plan vs actual for two rows (First & Secound) as shown below table.

 

When iam trying to fetch the excel data in power bi desktop. its taking column wise Formate like General and Datatype is whole number, but i am not able to change the Formate into %. 

If i change the Formate into % its taking to entire column. but i want to apply only for cell or row not for column

 

Excel Data

CategoryPlanActual variance
first64-2
second32-1
difference53.18%51.28%-1.90%
third41476
fourth1-4-5

 

Power BI After Fetching data from excel.

 

NadeemAhamed_0-1705403035663.png

 

NadeemAhamed_1-1705403052926.png

 

1 ACCEPTED SOLUTION

change the measure to : 

Plann = SWITCH(TRUE(),SELECTEDVALUE(Testing[Order]) in {3}, FORMAT(CALCULATE(SUM(Testing[Plan])),"##.#%"),FORMAT(CALCULATE(SUM(Testing[Plan])),"##"))
Daniel29195_0-1705580816321.png

 

 

l

View solution in original post

22 REPLIES 22
Daniel29195
Super User
Super User

in power bi, the datatype affect the whole column . 

it works different than excel, where you can set a datatype per cell. 

 

 

Ok then is their any solution to provide the difference in % by using measures or else (for First and Secound Rows)

 

in category, you only have  first, second,  third and fourth ? 

Yes i have, but when iam taking this excel data into Power BI its taking as i have explained above. 

but i want to take difference for plan vs actual in row wise. 

 

not sure if this is exactly what you need  but  : 

i created this table : 

 

Daniel29195_2-1705408195343.png

 

 

and this is the ouput result : 

Daniel29195_1-1705408175987.png

if this is what you want  : 

step 1 : you need first to create a column called index 

step 2 :  the row difference convert it into decimal

step 3 :  change the datatype of columns in power query to decimal 

Daniel29195_4-1705408356784.png

 

step 4 : sort column category by column order 

Daniel29195_3-1705408267061.png

 

 

step 5  : create 3 measures  : 

plann =
SWITCH(
    TRUE(),
    SELECTEDVALUE('Table (5)'[order]) in {"3","6"} ,  FORMAT(CALCULATE(SUM('Table (5)'[plan]))*100,"%##.#"),
    FORMAT(CALCULATE(SUM('Table (5)'[plan])),"##")
)


actual =
SWITCH(
    TRUE(),
    SELECTEDVALUE('Table (5)'[order]) in {"3","6"} ,  FORMAT(CALCULATE(SUM('Table (5)'[acutal]))*100,"%##.#"),
    FORMAT(CALCULATE(SUM('Table (5)'[acutal])),"##")
)


variancee =
SWITCH(
    TRUE(),
    SELECTEDVALUE('Table (5)'[order]) in {"3","6"} ,  FORMAT(CALCULATE(SUM('Table (5)'[variance]))*100,"%##.#"),
    FORMAT(CALCULATE(SUM('Table (5)'[variance])),"##")
)


finally, drag and drop category to the visual,  and in values drag the 3 measures. 
Daniel29195_5-1705408434454.png

 

 

 

@NadeemAhamed  



@Daniel29195  Thank you for your valuable time to provide the solution.

 

I am getting one error after trying above steps. "Can't display the visual"

 

1. I have created index column and 3 measures after column type change.

NadeemAhamed_0-1705466947859.png

 

NadeemAhamed_3-1705467120324.png

 

2. i have used category in Rows and all 3 measures in values

NadeemAhamed_2-1705467055131.png

 

3. Error:- Can't display the visual

NadeemAhamed_1-1705467035230.png 

Error Log:

NadeemAhamed_4-1705467205924.png

 

 

 

 

 

 

hey,

in the measure it seems that you are comparing text with integers.

 

try removing the double quotes   in { "3","6" } 

write it like this :  in { 3,6 } 

 

 let me know if this works. 

 

@Daniel29195  Thank you soo much for your valuabe time to provide the solution. 

 

Yes its working fine. 

Now its coming like %53.2 but i need to show the percentage after the number like 53.2%. Is it possible?

yes of course. just  change "%##.#" to "##.#%"

this would work.

Dear @Daniel29195,

 

Its giving the error. 

NadeemAhamed_0-1705487958068.png

 

 

Dear @Daniel29195 ,

 

I have tried with this also.

NadeemAhamed_0-1705489844044.png

result would be :

NadeemAhamed_1-1705489880442.png

 

Can you please guide me to resolve this. 

i want to show the data like 52.1%

could you please send a screenshot of the raw data you are using in power bi ? 

NadeemAhamed_0-1705493804625.png

 

the Difference row you need to change it to : 

0.5318        

0.5128

 

since in the measure you are multiplying by 100 . 

 

 

Dear @Daniel29195 , 

 

i have changed the raw data from 53.18% to 0.5318 

but result is same.

 

In the measures where we are brining this percentage value, i think thier only we need to change the format to bring the percentage as per the standard value.

 

Dear @Daniel29195,

 

Can you please help me out, how to bring the % after the number, its really helping me a lot. 

 

is it possible that you can share the pbix file so i can take a look ?  

you can upload it to google drive and send the link to it so i can download it and take a closer look of why things arent working out from your side . 

Dear @Daniel29195,

 

Please find the BOX link to download the Pbix for your reference. 

https://toyotsu.box.com/s/lwzyx9gyu4wxppziusrfzk7ilaxxuuch

Dear @Daniel29195 

 

I hope you have received the Pbix file for reference.

Thank you in advance. 

change the measure to : 

Plann = SWITCH(TRUE(),SELECTEDVALUE(Testing[Order]) in {3}, FORMAT(CALCULATE(SUM(Testing[Plan])),"##.#%"),FORMAT(CALCULATE(SUM(Testing[Plan])),"##"))
Daniel29195_0-1705580816321.png

 

 

l

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.