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
MorganeLachuer
New Member

Résultat d'un calcul sur toutes mes lignes

Bonjour,

 

J'ai crée un calcul (volume) qui me permet de faire la somme de 'amount' si operation type = capture ou payment et si execcode = 0

 

Voici mon calcul : CALCULATION ( SUM( table[amount] ; execCodes [code] = "0"; table[operationType] = "capture" || table[operationType] = "payment" )

 

Le résultat que m'affiche PB est correct. Mon problème est que quand je mets operation type en colonne et que j'appelle mon calcul, PB me duplique le résultat sur toutes les lignes (voir ci-dessous) au lieu de m'afficher le résultat uniquemment sur payment et capture.

 

OperationTypeVolume
authorization         78€
capture         78€ 
credit         78€
payment         78€

 

Savez-vous s'il existe un moyen de corriger cela ?


Merci d'avance,

 

Morgane

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @MorganeLachuer 

The simple way is to add a conditional in your formula:

For example:

Voici mon calcul : IF( table[operationType] = "capture" || table[operationType] = "payment" ,  CALCULATION ( SUM( table[amount] ; execCodes [code] = "0"; table[operationType] = "capture" || table[operationType] = "payment" ) )

 

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.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @MorganeLachuer 

The simple way is to add a conditional in your formula:

For example:

Voici mon calcul : IF( table[operationType] = "capture" || table[operationType] = "payment" ,  CALCULATION ( SUM( table[amount] ; execCodes [code] = "0"; table[operationType] = "capture" || table[operationType] = "payment" ) )

 

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.

Hi Lin,

 

Thank you very much ! That's exactly what I wanted 🙂

 

Best Regards,

 

Morgane

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.