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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.