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
Anonymous
Not applicable

fix measure to work on all rows

hi guys,

i want to create a measure that works on all row fileds in the pivot table below. The measure has to be calculated on sum of values of "pz kit" considering only the rows that have min value of "tipo accessorio" (excluding 0) for each"item kit".

Below I've highlighted the rows that has to be sum up on the data set and on pivot table in green where the measure is working and in red when is not returning a correct value when you collapse the data on that level or calculate grand total.

 

i've tried to create a measure but i can't exclude 0s and make it works as i expect. Can you help me please?

here's the link of the excel file https://1drv.ms/u/s!AlibJbtIbDxpiN8WlkZNdQWH5Zi55g?e=mBQ8ct

Cattura.PNG

5 REPLIES 5
dax
Community Support
Community Support

Hello @alledem ,

You could check my sample for more information

Saludos
Zoe Zhi

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

Anonymous
Not applicable

can you please share the measure syntax? i can't open the report because i'm using power pivot on excel and i'm not allowed to install powerbi desktop

dax
Community Support
Community Support

Hi @alledem ,

Here is measure

Measure = sumx( SUMMARIZE('Table','Table'[famiglia],'Table'[tipo ordine],'Table'[modello],'Table'[item kit], "min", CALCULATE(MIN('Table'[pz kit]), FILTER('Table','Table'[pz kit]<>0))), [min])

686.PNG

Best Regards,
Zoe Zhi

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

Greg_Deckler
Super User
Super User

You can get rid of zeros by having a RETURN statement like the following:

 

RETURN

  IF(__SomeVariable = 0,BLANK(),__SomeVariable)

 

The other looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

When using SUMMARIZE, we need to use SUMX before it in the measure. I’m with Sam, don’t think your ProdPermTerms # is correct. Don’t quite know if I have your measure set up correctly, but know for sure that you need to implement SUMX into your Summarize variable measure. I believe you are very close to

 

 

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.

Top Solution Authors