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

HELP UNDERSTANING ALL AND ALLEXCEPT

Hello,

I just happened to try this out to get the number of parts,was more of a trial but is there a place where i can read
how the below functions were applied.I read that Count would bring the count of the values in the column but how is
ALLEXCEPT AND ALL altering the result.


Count_part = calculate(COUNT('Spend'[Part]),ALLEXCEPT('Spend','Spend '[Part] ))

Colour Part count_part
Black      A     3
Red        A     3
Blue        A    3
Blue         B    1


Count_part = calculate(COUNT('Spend'[Part]),ALL('Spend','Spend '[Part] ))


Colour Part count_part
Black      A    1
Red         A   1
Blue         A   1
Blue         B    1


Thanks

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@Anonymous 

please refer to below links for help

 

https://dax.guide/allexcept/

 

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

 

https://www.sqlbi.com/blog/marco/2010/04/05/all-allexcept-and-values-in-dax/

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

According to the syntax of CALCULATE function, Calculate(expression, filter). Calculate will use the parameter ‘filter’ to modify the filter context, choose or remove rows and then calculate the ‘expression’.

All and AllEXCEPT can be used as filters of CALCULATEAll(table/columns) will remove all filters on the table or columns and return all the rows. So the result will not be affect by the type of ‘Colour’ and ‘Part’.  ALLEXCEPT (table, columns) function will remove all filters on the table except the filters on the parameter ‘columns”. So the result will be affected by the type of ‘Part’ but not ‘Colour

 

For more details about using ALL and ALLEXCEPT, you can refer How to use ALL and ALLEXCEPT Function in Power BI DAX.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

negi007
Community Champion
Community Champion

@Anonymous 

please refer to below links for help

 

https://dax.guide/allexcept/

 

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

 

https://www.sqlbi.com/blog/marco/2010/04/05/all-allexcept-and-values-in-dax/

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Anonymous
Not applicable

@v-cazheng-msft @negi007 

 

Thanks for helping

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.