The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
How I get the total??
I tried the option below:
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
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...
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |