cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Problem with formula

Hello,

 

I have a problem with my formula and i don't understand why it's not possible to do this.

 

DIFF = CALCULATE(SUM(Commandes[LCCNVALCDE]);TEST[References.ValeursUtilise])-CALCULATE(SUM(Commandes[LCCNVALCDE]);IF(TEST[References.ValeursUtilise]<>"H-OF";TEST[References.ValeursUtilise]+1;""))

 

Commandes[LCCNVALCDE] -> type int

TEST[Refrences.ValeursUtilise] -> type string

 

H-OF is last value in my table so i want block this formula when TEST[Refrences.ValeursUtilise] =H-OF

7 REPLIES 7
Highlighted
Anonymous
Not applicable

Re: Problem with formula

Hi @AlexGallet01

 

 

Make this as a calculated column first:

 

Some column = IF(TEST[References.ValeursUtilise]<>"H-OF";TEST[References.ValeursUtilise]+1;BLANK())

 

 

Then create your measures after and adjust them to your newly calculated column.

 

Let me know how it goes.

 

Best,

Martin

Highlighted
Helper IV
Helper IV

Re: Problem with formula

Hi ValubiMartin,

 

I can't do this column i have an error message with value before H-OF.

The message speak about impossible to convert my value type of string in int.

Highlighted
Anonymous
Not applicable

Re: Problem with formula

Can you send me a picture of how your data is stored?

Highlighted
Helper IV
Helper IV

Re: Problem with formula

Capture.PNG

Highlighted
Community Support
Community Support

Re: Problem with formula

Hi @AlexGallet01,

 

You can try to use below calculate column formula if it suitbale for your requirement:

DIFF= IF(TEST[References.ValeursUtilise]<>"H-OF",CALCULATE(SUM(Commandes[LCCNVALCDE]),TEST[THKTNODOS])-CALCULATE(SUM(Commandes[LCCNVALCDE]),TEST[THKTNODOS]+1),blank())

 

BTW, I think you should use the index column to calculate the diff. Actually, you are try to calculate between number and text. Smiley Happy

 

Regards,

Xiaoxin Sheng

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

Re: Problem with formula

No mi calcul it's between the sum of price command where my thknodos have the first value and th sum of price command where the value of thknodos  have the second value. And next i want to do this between all thknodos.

Highlighted
Community Support
Community Support

Re: Problem with formula

Hi @AlexGallet01,

 

>>No mi calcul it's between the sum of price command where my thknodos have the first value and th sum of price command where the value of thknodos  have the second value.

For this requirement, you should create a measure to compare between current and previous. If this is a case, you need to find out a index column to help calculate through all your records.

 

Regards,

Xiaoxin Sheng

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors