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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculation at a fixed level of detail

Hi all,

I'm struggling with what I'd call in a tableau world a fixed level of detail expression. In DAX I'm aware they work differently, I've successfully used CALCULATE and ALLEXCEPT in previous formulas where the filter is binary. This one I'm stuck with!

 

In the below example I am filtered to a store. Sales density is simply Weekly Average Sales/ Traited. I'm wanting the final column 'Sales Density Test' to be the same calculation but fixed to a banding in the dataset based on the store size and its banding. Therefore when you look at Baby you can see the sale density for that store, but also the average sales density in comparable stores.

 

The size banding could be one of eight options rather than a fixed option. That option changes depending on what store you filter to.

 

My (failed) attempt below:

 

Sales Density Test = CALCULATE(SUM('Datacube Sales Info CSV'[Weekly Average Sales])/SUM('Datacube Sales Info CSV'[Traited]),ALLEXCEPT('Size Banding Data','Size Banding Data'[Store]))

 

 

PowerBI Screenshot.jpg

 

Any help or ideas are appreciated. I've combed through several posts but none seemed applicable

1 ACCEPTED SOLUTION
Anonymous
Not applicable

So I believe I have fixed this myself. Solution for anybody who stumbles across the post.

 

The formula was falling down as I was misunderstanding ALLEXCEPT. The way to understand it my side is it creates a blank slate, you then let factors through one by one.

 

In the below formula I could simply copy the original Weekly Average Sales/ Traited calculation. With no filter criteria applied the calculation mimiked the original. One by one I allowed criteria to influence the calculation, eventually ending up with my answer below.

 

Sales Density Test = CALCULATE([Sales Density], ALLEXCEPT('Datacube Sales Info CSV','Datacube Sales Info CSV'[Size Banding],'Datacube Sales Info CSV'[POG_Cat_Desc],'Datacube Sales Info CSV'[Area],'Datacube Sales Info CSV'[Department],'Datacube Sales Info CSV'[Division]))

View solution in original post

1 REPLY 1
Anonymous
Not applicable

So I believe I have fixed this myself. Solution for anybody who stumbles across the post.

 

The formula was falling down as I was misunderstanding ALLEXCEPT. The way to understand it my side is it creates a blank slate, you then let factors through one by one.

 

In the below formula I could simply copy the original Weekly Average Sales/ Traited calculation. With no filter criteria applied the calculation mimiked the original. One by one I allowed criteria to influence the calculation, eventually ending up with my answer below.

 

Sales Density Test = CALCULATE([Sales Density], ALLEXCEPT('Datacube Sales Info CSV','Datacube Sales Info CSV'[Size Banding],'Datacube Sales Info CSV'[POG_Cat_Desc],'Datacube Sales Info CSV'[Area],'Datacube Sales Info CSV'[Department],'Datacube Sales Info CSV'[Division]))

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.