cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors