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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
rvszilli99
New Member

Someone Can Help with Calculating the total visible in a table

 

How I get the total??

 

rvszilli99_0-1729179761253.png

 

I tried the option below:

 

rvszilli99_0-1729179932436.png

 

 

2 REPLIES 2
dharmendars007
Super User
Super User

Hello @rvszilli99 , 

 

The key here is to use SUMX to calculate the sum dynamically across the rows. This function evaluates an expression for each row in a table and then sums the result, ensuring that the total reflects row-level calculations correctly.

 

Please try this corrected measure..

 

Net Sales by FY =
VAR CurrentFiscalYear = CALCULATE(SELECTEDVALUE('Date'[Fiscal Year No]))
VAR PreviousFiscalYear = CurrentFiscalYear - 1

VAR fySalesDay =
CALCULATE(SUM('Sales'[Net Amount]),FILTER('Date', 'Date'[Fiscal Year No] = CurrentFiscalYear))

VAR TotalSales =
SUMX(VALUES('Date'[Fiscal Day Of Year]),CALCULATE(SUM('Sales'[Net Amount])))

RETURN
IF(HASONEVALUE('Date'[Fiscal Day Of Year]),fySalesDay,TotalSales)

 

When you see incorrect totals, it's often because DAX doesn't aggregate the individual row calculations properly at the total level. SUMX ensures each row is evaluated and summed correctly, yielding an accurate total.

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

 

 

 

 

lbendlin
Super User
Super User

Totals don't know what SELECTEDVALUE is.  Use a materialization like SUMMARIZECOLUMNS and then an aggregation function like SUMX.

 

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

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? 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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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