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
Carlsberg987
New Member

Problem creating measures in a measure-table

Hi,
 
I have a separate Measure table set up and im trying to create measures there to use in my visuals. For some reason I fail to create a percentage measure, that gives the customer's share of total sales. What am I doing wrong here? Apparently the result is not a single figure.
 
Total sales per customer (works):
 
CustomerShareOfSales = SUMX(
'SalesInvoices',
'SalesInvoices'[TotalSum]
)


Total percentage of sales per customer (does not work):
 
CustomerShareOfSales-% =
Divide([CustomerShareOfSales],ALL('SalesInvoices'[TotalSum]))
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@Carlsberg987 

ALL() is a filter function, it's not return any number to divide

try

 

Divide(
[CustomerShareOfSales],

CALCULATE(SUM(SalesInvoices[TotalSum]), ALL(SalesInvoices) )
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
az38
Community Champion
Community Champion

@Carlsberg987 

ALL() is a filter function, it's not return any number to divide

try

 

Divide(
[CustomerShareOfSales],

CALCULATE(SUM(SalesInvoices[TotalSum]), ALL(SalesInvoices) )
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank you this works! Do i understand the CALCULATE in this correctly: It creates a new filter context in which the SUM is evaluated in and is therefore mandatory?

@Carlsberg987 

well,CALCULATE() in this case allows you to evaluate ALL() context as a filter


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.