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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Cost_Control_BR
New Member

How to calculate from a measure ?

Hello everybody,

 

I'm not expert in DAX and I'm blocked... I'm doing a menu engineering and I put some categorie's name for each product sold like "Etoile", "Vache à lait", "Enigme" and "Poids Mort" for the below measure :

Catégorie = IF(AND([Indice Popularité]="BASSE",[Indice RDM]="BASSE"),"Poids Mort", IF(AND([Indice Popularité]="HAUTE",[Indice RDM]="HAUTE"),"Etoile",IF(AND([Indice Popularité]="HAUTE",[Indice RDM]="BASSE"),"Vache à lait","Enigme")))

Now I want to calculate how many "Etoile" I have in my selection to pur this number in the map icon above.

Capture.JPG


How I can do this ??


1 ACCEPTED SOLUTION

you can return COUNTROWS instead of SUMX.

View solution in original post

8 REPLIES 8
lbendlin
Super User
Super User

You cannot measure a measure. You need to materialize it first,  or create a separate measure that implements the entire logic.

Thanks for your response but how can I do this ? Tell me if zou need for details.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Menu Engineering TEST.pbix

 

Is it ok like this ?

Not sure what your expected outcome is, but something like this

 

Etoile = 
var a = ADDCOLUMNS(VALUES('Menu Engineering'[Article / Produit]),"q",sum('Menu Engineering'[Qté]),"e",calculate([Catégorie]))
return sumx(filter(a,[e]="Etoile"),[q])

We are on the good way hehe !!
This formula give me the total of the quantities : 12

But I want a formula who shows how many product I have with the category "Etoile", how many with the category "Enigme", etc...
In this example, I need to have 1 "Etoile", 1 "Enigme" and 1 "Poids Mort".
Capture.JPG

I hope I've made my explanations clear enough...

you can return COUNTROWS instead of SUMX.

Excellent, it worked !!

Thank you so much for your help !
Capture.JPG

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors