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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
james_pease
Helper III
Helper III

Division Based on Condition/Filter

Good morning,

I am using the current formula in a measure:

Annual Impacted True ROI =
CALCULATE (
    DIVIDE (
        ( [Monthly Profit Difference (excess)] * 12 ),
        Calculate(SUM ( 'Dev projects'[Total Cost] ), 'All Actual Data'[Store Impacted])
    ),
    StoreList[StoreNumber]
)
 
james_pease_0-1716308960737.png

 

What I am trying to do is divide by the total cost for the Store Impacted hence the calculate filter by [Store Impacted]. I do not want to divide by the [Total Cost] for a specific Store, I want to divide the profit by the store being impacted [Total Cost]. The Store Impacted column is a calculated column in the 'All Actual Data' table which is a lookupvalue formula pulling the actual column from the 'ROI_Impact_Stores' table. An unnecessary step as their is a relationship between the two tables, just providing more context.

For example, in the image above, I want to divide the monthly profit excess measure by the cost for the test store, 13348 (this is the Store Impacted) for each control store and the test store.
So monthly profit for 13268 / cost for store 13348. 
 
Thank you in advance!
1 ACCEPTED SOLUTION
james_pease
Helper III
Helper III

Thank you! This helped me come up with an alternative solution. I created a lookupvalue column (just so I can visually see):

 

Total Cost Store Impacted = LOOKUPVALUE('Dev projects'[Total Cost], 'Dev projects'[Store], ROI_Impact_Stores[Store Impacted])
Then I adjusted the formula for the annual true ROI measure:

Annual Impacted True ROI =
    DIVIDE (
        ( [Monthly Profit Difference (excess)] * 12 ),
         CALCULATE(sum('ROI_Impact_Stores'[Total Cost Store Impacted])
    )

)

View solution in original post

3 REPLIES 3
james_pease
Helper III
Helper III

Thank you! This helped me come up with an alternative solution. I created a lookupvalue column (just so I can visually see):

 

Total Cost Store Impacted = LOOKUPVALUE('Dev projects'[Total Cost], 'Dev projects'[Store], ROI_Impact_Stores[Store Impacted])
Then I adjusted the formula for the annual true ROI measure:

Annual Impacted True ROI =
    DIVIDE (
        ( [Monthly Profit Difference (excess)] * 12 ),
         CALCULATE(sum('ROI_Impact_Stores'[Total Cost Store Impacted])
    )

)

Ok, now find a solution that does not use LOOKUPVALUE...

lbendlin
Super User
Super User

You are supplying filter conditions that always evaluate to true. Modify your filters so the actually have an effect.

 

The outer CALCULATE is likely not needed.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.