Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Biggest puzzler yet: I have this measure called [%Need]. The sum total of these percentages needs to be 1 in order to compute correctly. However, it's not, so in order to correct it I need to do a formula like: [%Need]/Sum [%Need] *1. So in order to get sum portion I did:
CALCULATE(SUMX(VALUES('Calendar'[calendar date]),[%Need]),ALL('Calendar'[CalendarDate]))
This puts 1(I checked it out to 15 0s 1.00000000000000 in each row instead of the correct amount which is 1.0147. 1.0147 however appears in the Total at the bottom. I need 1.0147 in each row so I can have it divided by [%Need]. This probably doesn't need to be included, but just in case the [%Need] measure is:
IF([CALendarDATE]>LASTNONBLANK ( 'Calendar'[Calendar Date], [Gross Adds]),[PYGA]/([PYALLGAs]-[GAsLyMAXDateAll]),Blank())
Any idea how to get the correct total in each row?
Hi @BrianNeedsHelp,
The issue arises because DAX treats row context and filter context differently when calculating totals versus individual rows. Here's a breakdown of what's happening and how to fix it:
You want each row to reflect the correct percentage by dividing the row's %Need value by the sum total (1.0147). To achieve this:
[%Need Adjusted] = VAR TotalNeed = CALCULATE(SUMX(VALUES('Calendar'[Calendar Date]), [%Need]), ALL('Calendar')) RETURN DIVIDE([%Need], TotalNeed)
CALCULATE with ALL:
Row-Level Context:
DIVIDE for Safety:
Add a temporary measure to verify the TotalNeed:
TotalNeed = CALCULATE(SUMX(VALUES('Calendar'[Calendar Date]), [%Need]), ALL('Calendar'))
This should return 1.0147 consistently across all rows.
Test the %Need Adjusted measure in your table visual.
Let me know if this resolves the issue or if you need further clarification!
Please mark this as solution if it helps you. Appreciate Kudos
Thanks for your reply and explanation. However that measure does the same thing. 1 in all the rows and 1.0147 in the total.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |