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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
HelpImStuck
Frequent Visitor

LOD and measure totals

I am stuck trying to maintain the same measure total when removing a column from a table visual. Here is my current measure, which gives the correct result and the correct total:

 

BD SUM =
VAR A =
SUMMARIZE (
Sheet1,
Sheet1[brand],
"Avg",
(
AVERAGE ( Sheet1[income] ) * Income[Income Value]
)
+ (
AVERAGE ( Sheet1[education] ) * Education[Education Value]
)
+ (
AVERAGE ( Sheet1[age] ) * Age[Age Value]
)
+ (
AVERAGE ( Sheet1[ethnicity] ) * Ethnicity[Ethnicity Value]
)
+ (
AVERAGE ( Sheet1[house] ) * 'Household Size'[Household Size Value]
)
+ (
AVERAGE ( Sheet1[marital] ) * 'Marital Status'[Marital Status Value]
)
+ (
AVERAGE ( Sheet1[children] ) * 'Presence of Children'[Presence of Children Value]
)
)
RETURN
SUMX (
A,
[Avg]
)

When adding this measure to a table visual, it generates this result:

 

idbrandBD SUM
9007900349A2.45
9007900349B1.63
9007900349C2.4
9007900349D2.5
9007900349E1.88

 

The total of all 5 values is 10.86 which is correct, however, when I remove the 'brand' column from the table visual, it gives the wrong total. Any ideas how I can produce this result?

 

idBD SUM
900790034910.86


I have tried every iteration of ALL, ALLEXCEPT, and VALUES I can think of but nothing seems to work. Appreciate the help!

5 REPLIES 5
some_bih
Super User
Super User

Hi @HelpImStuck sure. 

It could be transformed into dimension using power query





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

Proud to be a Super User!






some_bih
Super User
Super User

Hi @HelpImStuck your definition for measure include brand, this is reason you "have" to have brand .Rewrite measure, try directly without variable part.

Sheet1[brand],

 





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

Proud to be a Super User!






Hi @some_bih, the measure needs to calculate the sum of the averages by brand, which in this case is 10.86, but the visual needs to display that by ID. In my example there are 5 brands under ID 9007900349, and the the sum of the averages on those 5 brands is 10.86, so in a bar chart with ID as the y-axis, ID 9007900349 needs to have the value of 10.86. For some reason this does not calculate correctly unless I also include brand

Hi @HelpImStuck did you try to use dimension table not fact table?





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

Proud to be a Super User!






@some_bihthis is all one table, provided in a single CSV file

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors