cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Manisri_Dava Frequent Visitor
Frequent Visitor

Calculated column is giving wrong result

Hi,

I want to create 2 new calculated columns like follows

            incoming = if [Debit/Credit] = S  then  [amount in company code currency]

            outgoing = if [Debit/Credit] = H then  [amount in company code currenty]*-1

 

I have used the below formulas

Outgoing = IF ( SAP_BSEG[Debit / Credit]="H", SAP_BSEG[Amount in company code currency]*-1,BLANK() )
Incoming =  IF ( SAP_BSEG[Debit / Credit]="S", SAP_BSEG[Amount in company code currency],BLANK())
 
for some values it's showin the right result but for some values it's showing the wrong values like below
 
 
Capture.PNG
 
My expected result is for example
 
Capture.PNG
 
Please help me with this
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calculated column is giving wrong result

hi, @Manisri_Dava 

For your case, I think it is because the calculate column value is aggregated in the visual.

Please set them don't summarize, or change [amount in company code currency] is SUM

https://docs.microsoft.com/en-us/power-bi/service-aggregates#change-how-a-numeric-field-is-aggregate...

2.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 REPLIES 6
nsrshkh1 Member
Member

Re: Calculated column is giving wrong result

@Manisri_Dava ,

 

I don't how you are getting incorrect results. I used same method howver I am getting correct results.

 

https://1drv.ms/u/s!Ah0UhoGdkH5biiJPFN0W1s6GvEox?e=z1LTbx

 

 

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

 

novilpawar Frequent Visitor
Frequent Visitor

Re: Calculated column is giving wrong result

@Manisri_Dava  Hi,

 

Are credit and debit is same as incoming and outgoing? If it is same then it should be working fine. It worked for me.

another question is Are credit and debit Calculated column or Measures?

Manisri_Dava Frequent Visitor
Frequent Visitor

Re: Calculated column is giving wrong result

I don't know how I am getting the wrong values, but when I used the same data in a fresh pbix file the values are coming correct but in my existing if I implement the same logic wrong values are coming.

Manisri_Dava Frequent Visitor
Frequent Visitor

Re: Calculated column is giving wrong result

can anyone help me how to write the below query in M language

 

Outgoing = IF ( SAP_BSEG[Debit / Credit]="H", SAP_BSEG[Amount in company code currency]*-1,BLANK() )

Highlighted
nsrshkh1 Member
Member

Re: Calculated column is giving wrong result

@Manisri_Dava 

 

Use Table2 for Power Query solutions

 

https://1drv.ms/u/s!Ah0UhoGdkH5biiJPFN0W1s6GvEox?e=z1LTbx

 

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

Community Support Team
Community Support Team

Re: Calculated column is giving wrong result

hi, @Manisri_Dava 

For your case, I think it is because the calculate column value is aggregated in the visual.

Please set them don't summarize, or change [amount in company code currency] is SUM

https://docs.microsoft.com/en-us/power-bi/service-aggregates#change-how-a-numeric-field-is-aggregate...

2.JPG

 

Best Regards,

Lin

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

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 244 members 3,000 guests
Please welcome our newest community members: