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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Pii
Regular Visitor

How to use a result of a measure in another measure

Hi there, 

 

It's my first post here. I hope this will find you well. 

I've created a measure which calculates the percentage of the costs.

Now I want to use these percentages to calculate the Turnover per employee according to their costs. How can I use the result of  a measure in another measure? 

Cost in % = 

VAR CurrentOrder = Values(expensepostings[order_id])
VAR CurrentSuborder = Values(expensepostings[suborder_id])
VAR TotalCosts =
SWITCH(
    TRUE(),
    ISINSCOPE(employees[display_name]), CALCULATE(SUM(expensepostings[cost_amount]), ALLSELECTED(expensepostings), expensepostings[order_id] IN CurrentOrder, expensepostings[suborder_id] in CurrentSuborder),
    ISINSCOPE(expensepostings[suborder_id]), CALCULATE(SUM(expensepostings[cost_amount]), ALLSELECTED(expensepostings), expensepostings[order_id] IN CurrentOrder),
    ISINSCOPE(expensepostings[order_id]), CALCULATE(SUM(expensepostings[cost_amount]),ALLSELECTED(expensepostings))
)
RETURN
IF(
    ISINSCOPE(expensepostings[order_id]),
        DIVIDE(expensepostings[Gesamtkosten], TotalCosts),
    1
)
 
Depending on which level I am this measure will calculate the percentage of costs according to the order_id, the suborder_id or the employee name. The result on employee level is shown here: 

Pii_0-1705588168543.png

 

Now I have the percentages from each employee per suborder. I want to use these percentages to calculate the turnover for each employee per suborder.  In the order table I have the information that suborder 19790 has a turnover of 875. But I don't know how to use the calculated percentages. 

I would like to excpect the turnover for each employee per suborder like this: 

Pii_2-1705589201910.png

 

Does somebody has an idea how to do this? 

 

1 REPLY 1
lbendlin
Super User
Super User

You cannot measure a measure.  Implement your entire business logic in a single measure.

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors