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

Percent total denominator help with calculation

I'm new to DAX and struggling with returning the total amount denmoniator for a percent calculation using slicers. 

I want the Denomintator to equal 40,170 for all rows in this table. The CE total denominator should = All Brand Families, All Manufacturers, and Draught/Package using the slicers year (2018) and Beer Style (Brown Ale). Filtering by Draught/Package, Brand Family, and Manufactures should not change the total denominator. 

 

Capture01.JPGCapture02.JPG

 

Capture03.JPG

 

I don't understand why the denominator (total) is not calculating correctly in the grid. 

 

= divide(sum(FactVwDwEoStarPBIOrders[Case Equivalency]), calculate(sum(FactVwDwEoStarPBIOrders[Case Equivalency]),
ALLEXCEPT(Filter_B_DimVwBrandFamiliesOrders, Filter_B_DimVwBrandFamiliesOrders[BrandFamilyKey]),
ALLEXCEPT(Filter_B_DimVwManufacturersOrders, Filter_B_DimVwManufacturersOrders[ManfKey]),
ALLEXCEPT(FilterVwPackOrders, FilterVwPackOrders[PkgKey])
))
 
I thought this would mean, get the sum total using slicer year 2018 and slicer Beer Style. This is the calculation I use in the 3rd images Brown Ale Case Equivalency 02 = 40,170. Why doesn't it work as the denominator in the grid and what should I adjust to make it work in the percentage formula?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I was able to get the totals by using allexcept filters and removing the joins. 

ce total style items 2 =
CALCULATE
(
SUMX(
CALCULATETABLE(FactVwDwEoStarPBIOrders,
ALLEXCEPT(Filter_B_DimVwBrandFamiliesOrders, Filter_B_DimVwBrandFamiliesOrders[BrandFamilyKey]),
ALLEXCEPT(Filter_B_DimVwManufacturersOrders, Filter_B_DimVwManufacturersOrders[ManfKey]),
ALLEXCEPT(FilterVwPackOrders, FilterVwPackOrders[PkgKey]),
CROSSFILTER(FactVwDwEoStarPBIOrders[ItemKey], DimVwItemsSold[ItemKey], None),
CROSSFILTER(FactVwDwEoStarPBIOrders[BrandKey], Filter_B_DimVwBrands[BrandKey], None)
),
FactVwDwEoStarPBIOrders[Case Equivalency]
)
)
 
Then I created the % formula:
ce per 2 = divide(sum(FactVwDwEoStarPBIOrders[Case Equivalency]), [ce total style items 2])

View solution in original post

3 REPLIES 3
satichun
Frequent Visitor

Hi 

 

How did you solve this?

Anonymous
Not applicable

I have not solved this and i'm still looking for help.

Anonymous
Not applicable

I was able to get the totals by using allexcept filters and removing the joins. 

ce total style items 2 =
CALCULATE
(
SUMX(
CALCULATETABLE(FactVwDwEoStarPBIOrders,
ALLEXCEPT(Filter_B_DimVwBrandFamiliesOrders, Filter_B_DimVwBrandFamiliesOrders[BrandFamilyKey]),
ALLEXCEPT(Filter_B_DimVwManufacturersOrders, Filter_B_DimVwManufacturersOrders[ManfKey]),
ALLEXCEPT(FilterVwPackOrders, FilterVwPackOrders[PkgKey]),
CROSSFILTER(FactVwDwEoStarPBIOrders[ItemKey], DimVwItemsSold[ItemKey], None),
CROSSFILTER(FactVwDwEoStarPBIOrders[BrandKey], Filter_B_DimVwBrands[BrandKey], None)
),
FactVwDwEoStarPBIOrders[Case Equivalency]
)
)
 
Then I created the % formula:
ce per 2 = divide(sum(FactVwDwEoStarPBIOrders[Case Equivalency]), [ce total style items 2])

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.