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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Measures totals needed to SUM based on selected Date

I have 4 measures as per table below and they are working correctly per row, but I'm having issues to get the Total row as a SUM of each column.

How can I get the totals correctly as per table below? (the last row is the result that I want to achieve)


Work Item IDDateScriptsTransactions70% of Scripts70% of TransactionsSaved HoursSaved Amount
116491/06/2020110.70.70.7633.17
116501/06/2020150.73.50.9943.33
116571/06/2020130.72.10.8738.25
201381/06/2020170.74.91.1148.42
212381/06/2020130.72.10.8738.25
220132/06/2020110.70.70.7633.17
220142/06/2020150.73.50.9943.33
220152/06/2020150.73.50.9943.33
220162/06/2020130.72.10.8738.25
220172/06/2020130.72.10.8738.25
 Total1036725.29.0916397.7575



Thanks

1 ACCEPTED SOLUTION

@Anonymous - I would use something like HASONVALUE on your Date column. If it has one value, return your row measure. Otherwise, do your SUMMARIZE and SUMX. 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@Anonymous 

Add a table visual 

Fowmy_0-1597672342862.png

 




Measures

 

70% of Scripts = SUM('Table'[Scripts]) * .7

70% of Transactions = SUM('Table'[Transactions]) * .7

Saved Amount = [Saved Hours] *43.75

Saved Hours = ( [70% of Transactions]* 0.083)+[70% of Scripts]

 

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Anonymous , not clear the issue you are facing in this

Try like

70% of Scripts = Sum([Scripts])*0.7
70% of Transactions = Sum([Transactions])*0.7
Saved Hours = ([70% of Transactions ] * 0.083)+[70% of Scripts]
Saved Amount = Sum([Saved Hours]) *43.75

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Greg_Deckler
Super User
Super User

@Anonymous - This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

As for your measures themselves, Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 
Yes, this is exactly the issue that I'm having, with the totals.
I'm fine with the measures, I was able to get them right per row, but the totals are not correct for the day/month/year when I use my Date slicer.
I read your post explaining in details, but I only have basic Power BI skills, it couldn't get it to work properly 🙁.
I would really appreciate it if you could kindly help me to create the code for what you explained in my report's case.

 

This is what I have for the measures:

70% of Scripts = COUNT('Test Scripts'[Work Item Id])*0.7
 
70% of Transactions = sumx(VALUES('Test Scripts'[Date]), distinctcount('Transactions'[Work Item Id]))*0.7

Saved Hours Total = sumx(VALUES('Test Scripts'[Date]), distinctcount('Transactions'[Work Item Id])*0.083 + DISTINCTCOUNT('Test Scripts'[Work Item Id]))*0.7

Saved Amount Total = [Saved Hours Total] * (350 / 8 )

How should I correctly use the HASONEFILTER with them in order to get the totals displayed as per the total row in my example table above, in order to actually SUM the columns for the respective day or month or year, please?

Thank you very much in advance

@Anonymous - I would use something like HASONVALUE on your Date column. If it has one value, return your row measure. Otherwise, do your SUMMARIZE and SUMX. 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.