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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
airwolf39
Helper V
Helper V

Divide total using measures only

Hi all,

 

link to model: https://onedrive.live.com/?cid=9B9FE0DA1F0E085D&id=9B9FE0DA1F0E085D%213069&parId=root&o=OneUp

I have spent hours reading on this topic. I am very close, but cannot seem to get over the hump:

 

Capture.PNGData.PNG

 

What i want to be able to do is divide 'Filtered Numerator' by 'Denomiator' at the aggregated level for the total. My row data is good. Did i use 'Summarize' incorrectly?

 

Also, all my measures are SUMX formulas. For example: Capture.PNG

Thanks for you help guys.

11 REPLIES 11
Anonymous
Not applicable

HI @airwolf39.

You can take a look at the following links to know how to use 'if statement' to check current row content level and write an expression to handle total level calculations:

Clever Hierarchy Handling in DAX 

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Hi @Anonymous , 

 

That is what i have been trying to do. Use a IF(Hasonefilter) to write a secondary formula for the total row. No luck.

Anonymous
Not applicable

HI @airwolf39,

Can please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Its linked in the post. Thanks.

Anonymous
Not applicable

Hi @airwolf39,

In fact, I can't get sample data from the link you provided and it told me 'item missed'. Did this mean the file expired or you cancel the sharing?
Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@airwolf39 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Here is the link:https://onedrive.live.com/?cid=9B9FE0DA1F0E085D&id=9B9FE0DA1F0E085D%213069&parId=root&o=OneUp

 

What im trying to do for 'Capable fill rate %':

  • Numerator is [Todays Inventory on hand] + [WH4- week1]
  • Denomiator is [SO Week -1] + [OverDue SO]
  • Remove any negative values from the numerator (Today's inventory on hand). Those are system errors. But i want to keep them in the visual to highlight in meetings.
  • Have the capable fill rate in the total row be correct
  • The numerator cannot exceed the denominator, otherwise the capable fill rate would be over 100%. I used the min function to keep that from happening via a variable. 
  • I would prefer to build this all in measures and not calculated columns.

 

mahoneypat
Microsoft Employee
Microsoft Employee

Using variables like that in your SUMMARIZE is incorrect.  If you provide a link to your pbix (or a mock up of it), a specific solution can be provided.  In any case, I suspect you are looking for a measure like this one.

 

NewMeasure =
SUMX (
    VALUES ( 'David Production Planning Report'[FG-Parents INV] ),
    VAR denominator = [SO - Week 1] + [Overdue SO]
    VAR denominator =
        MIN (
            [Today's Inventory] + [WH4 - Week 1],
            denominator
        ) + 0
    RETURN
        DIVIDE (
            numerator,
            denominator
        )
)

 

If you have only the Parents INV column and the above measure in your table visual, this should give you the correct values on both rows and in the total.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


That ended up not working for me. The row data is fine, but not the total row:Capture.PNG

bump

AllisonKennedy
Super User
Super User

@airwolf39  Are you creating a new measure or a new column? What else do you have in your table in the screenshot if a measure? 

 

When you use variables, they are calculated when you define them and stored as a number, not as a formula. So if you want this calculated in the summarize, you may need to define them inside the SUMMARIZE function.

 

I'm not clear what you're trying to do, so if you can give more info we can help better.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors