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
Kaptah
Frequent Visitor

Slicer and Average of sum of two columns

Hello BI Community, newbie here!

I have a hobby, I play a game of extremly dangerous bio-mutated war ants. I'm collecting battle data and doing a report of it. Data is simple, it's on one table:

Kaptah_7-1655990902080.png

I've come this far:

Kaptah_6-1655990470842.png

Total damage = Skill Dmg + Unit Dmg: 

 

Dmg Total = SUM([Dmg Skills]) + SUM([Dmg Unit])

 

Front is a slicer affecting all cards on right and also slicer Special Ant.

Special Ant affects all cards on right. It is a calculated column: 

 

Special Ant = [SA] & " - " & [stars]

 

Everything is working except slicing Avg Total Damage and Max Total Damage. Values stay as average and max of whole data set regardless of slicer choices. Code:

 

Dmg Total Avg = AVERAGEX(ALL('Attack'), [Dmg Total])
Dmg Total Max = MAXX(ALL('Attack'), [Dmg Total])

 

What might be wrong with this? 
Big thanks to all in advance 🙂

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Kaptah ,

 

ALL in the two measures will make them ignore the slicers in "Attack" table. Try to use ALLSELECTED.

 

Reference: Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

 

 

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @Kaptah ,

 

ALL in the two measures will make them ignore the slicers in "Attack" table. Try to use ALLSELECTED.

 

Reference: Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

 

 

 

Best Regards,

Icey

 

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

Kaptah
Frequent Visitor

Anyone there?

 

I changed the Special Ant slicer to hierarchy, still not slicing.

Kaptah_0-1656157077811.png

 

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.