Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am struggling with using sumx and coming up with totals in my BI dashboard. I am calculating revenue YTD which includes a series of calculation to reach the revenue number. it is based on budgets(data in the tables) and % completions(calculated) of those budgets. My YTD number is not totalling accurately. My relationships:
my job table is connected to acc master with jobnum. The purpose of account master is mostly just to connect the jobs to account balances which has revenue, cost information by period. Each period is a column - no dates, one to many relationship from job to acc master
acc master to acc balance is one to many, account ID is the join
I have 12 measures for both each month of revenue and cost (24 totals for these) to calculate the changes in that month + prior year changes and beginning balances based on required criteria within acc balance tables. I am trying to create a revenue YTD measure which is dynamic that changes as period selection.
my budget formulas are something like this:
All those measures used in the measure above are something like this:
Solved! Go to Solution.
Hi @prakritnepal-cn ,
Please create another new measure as below to instead of the measure [ZrevenueYTD] on the visual in order to resolve the incorrect total value of ZrevenueYTD:
Measure = SUMX ( VALUES ( 'yourtable'[Job Description] ), [ZrevenueYTD] )
In addition, you can refer the method in the following links to resolve it.
Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand
Dax for Power BI: Fixing Incorrect Measure Totals
And for the problem in your last post, please update the formula of your measure [apr bud] as below and check whether it works or not:
Note: The part with red font is updated one.
apr bud = DIVIDE ( SUMX ( FILTER ( 'Merged', 'Merged'[f0902-acc balances.jobnum] = RELATED ( 'F0006-job'[jobnum] ) //whether this filter condition can be deleted? && 'Merged'[f0902-acc balances.Ledger Type] = "JA" && 'Merged'[f0902-acc balances.object account] IN { "1210", "1270", "1250", "1215", "1255", "1273" } ), 'Merged'[f0902-acc balances.apr] ), 100, 0 ) |
Best Regards
Hi @prakritnepal-cn ,
Could you please provide the screenshots about your table visual with data and Fields setting of this table visual just as shown in below screenshot? Also please explain which table or measure these fields come from.
Note: The screenshots need to mark the wrong values, what is the correct value and the related calculation logic.
Best Regards
Merged the tables to be able to use related function and getting this error when trying that way. Any suggestions? Issue with Filter statement criteria, not sure how to avoid this. The columns in question are all type text.
Hi @prakritnepal-cn ,
Please create another new measure as below to instead of the measure [ZrevenueYTD] on the visual in order to resolve the incorrect total value of ZrevenueYTD:
Measure = SUMX ( VALUES ( 'yourtable'[Job Description] ), [ZrevenueYTD] )
In addition, you can refer the method in the following links to resolve it.
Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand
Dax for Power BI: Fixing Incorrect Measure Totals
And for the problem in your last post, please update the formula of your measure [apr bud] as below and check whether it works or not:
Note: The part with red font is updated one.
apr bud = DIVIDE ( SUMX ( FILTER ( 'Merged', 'Merged'[f0902-acc balances.jobnum] = RELATED ( 'F0006-job'[jobnum] ) //whether this filter condition can be deleted? && 'Merged'[f0902-acc balances.Ledger Type] = "JA" && 'Merged'[f0902-acc balances.object account] IN { "1210", "1270", "1250", "1215", "1255", "1273" } ), 'Merged'[f0902-acc balances.apr] ), 100, 0 ) |
Best Regards
Thank you. It worked. used sumx and filter conditions inside the expression.
removed related from the formulas
Revenue YTD(Calculated Column) is the correct one
Z revenueYTD is incorrect as you can see the total is incorrect on that one:
Revenue YTD is calculated by series of custom columns:
Cost actuals : calculate(sum of all period columns YTD from acc balances table, filter (a bunch of criterias on different columns)
cost budget: similar calculation as cost actuals
% completed : cost actuals/cost budget
Revenue YTD = revenue Budget * % completed
ZrevenueYTD is a measure. The formulas are basically the same except this one is a measure instead of calculated column. Also uses selected value to determine YTD calculation (full formula mentioned in the initial post)
I have also tried sumx to see if I can get get correct totals but I think I need to use related function here and I am getting stuck on that piece trying that solution. The value for monthly numbers need to be in millions and it comes out in billions. My Sumx formula is something like this: Sumx (Filter(table, series of criterias),account balance month)
User | Count |
---|---|
97 | |
76 | |
76 | |
48 | |
26 |