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

Calculation Error in power BI

HI,

 

Can anyboday help me out to calculate % Gap in data.

 

I am sharing screenshot of  sample dataset and also "Expected Answer" column in data.

I have also shared formula used to calculate this column.

 

Below is the screenshot of the data.

 

 Screenshot-1.png

 

Thanks In Advance,

Rahul M

4 REPLIES 4
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

You can create a calculated column use DIVIDE() function with DAX below: 

 

Expected Answer=Divide([Gap(Actual - Plan)],[Plan Value])

 

Reference:

https://docs.microsoft.com/en-us/power-bi/desktop-tutorial-create-calculated-columns

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi,

 

thanks for reply.

 

I have tried this already but didint work actually..

 

I have got solution for it instead of calculted column i used calculated measure for it and it works fine now.

 

Again thanks for it.

 

Regards,

Rahul M

Hi @Anonymous,

 

Glad to hear the issue is fixed now. It would be better if you could share the measure which will benefit other communities who have the same issue. 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

HI All,

 

Sorry for late post of solution.

 

 I have  created new quick measure option. then i selected filtered value, from which i am able to calculate value for "yes" which is "plan value" and value for "No" which is "Actual value"....so i get two measure here i.e plan value and actual value.

Untitled-5.png

After above step is done, 

I simply calculate GAP between two by using formula Gap(Actual-Plan) = [Matric_Value for NO]-[Matric_Value for Yes]

Note: Matric_Value for NO=Plan Value and  Matric_Value for YES= Actual Value

 

Next and final step is to calculate Difference % y suing formula % Gap(Actual-Plan) = IFERROR([Gap(Actual-Plan)]/'rpt_Actual_vs_plan (2)'[Matric_Value for Yes],0)

 

 

Below is the output screenshot.

 

Untitled-6.png

 

Thanks,

Rahul M

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.