Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jo_Chrq
Helper I
Helper I

Equivalent SUMPRODUCT Power BI

Bonjour à tous,

 

Je cherche à effectuer une formule que j'imaginais simple mais que je ne parviens pas du tout à faire.

J'ai une table "Ventes" liée à 2 autres tables : Une "Articles" et une "Barèmes".

Les articles sont regroupés selon certaines catégories, chaque catégorie a un barème.

 

Je souhaite obtenir un montant total de barème équivalent à : Somme des quantités vendues par catégories * barème de la catégorie, et le total en bas du tableau.

 

La seule solution que j'ai trouvé est de faire :

Barème_22 = SUM('dwh tSales'[Qty]) * CALCULATE(AVERAGE('Montants Barèmes Annuels'[Bareme 2022]))

Alors j'obtiens le bon résultat dans la colonne mais le total est faux

 

Merci par avance

Jonathan

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Jo_Chrq ,

Depeding on table relation we bring the column into one table or use that in measure expression

 

Example

new column =  // 1-M relation

related('Montants Barèmes Annuels'[Bareme 2022])

 

measure= sumx('dwh tSales' ,'dwh tSales'[Qty]) *  related('Montants Barèmes Annuels'[Bareme 2022])

 

Other methods

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Jo_Chrq ,

Depeding on table relation we bring the column into one table or use that in measure expression

 

Example

new column =  // 1-M relation

related('Montants Barèmes Annuels'[Bareme 2022])

 

measure= sumx('dwh tSales' ,'dwh tSales'[Qty]) *  related('Montants Barèmes Annuels'[Bareme 2022])

 

Other methods

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Hi,

I used the measure with the RELATED function and it works just fine.

Thanks a lot!

Jonathan

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.