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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Dear Power BI community ,
I am trying to solve a problem related to TOPN DAX function. I want to show list of top 3 products based on their net sales. When I represents products and respective net sales values in a table, and filter the table based on TOPN products, then the total value is showing the correct value.
But when I create a dax measure using TOPN function I am getting different Total result. Though, I am not using any other filters in the report. A screen shot of the example and below DAX measure I am using is provided in the below table format.
How I can correct TOTAL NET SALES VALUES of TOP 3 products by using DAX measure ?
= SUMX(
TOPN(
3,
SUMMARIZE(
Sales,
Sales[ProductKey],
"NetSales", SUM(InternetSales[SalesAmount])
),
[NetSales], DESC
),
[NetSales]
)
Solved! Go to Solution.
Hi @ankbaner -You're absolutely right to observe the discrepancy
TopN Net Sales =
VAR TopProducts =
TOPN(
3,
ADDCOLUMNS(
VALUES(Sales[ProductKey]),
"NetSales", CALCULATE(SUM(InternetSales[SalesAmount]))
),
[NetSales], DESC
)
RETURN
SUMX(
TopProducts,
[NetSales]
)
Hope this works.
Proud to be a Super User! | |
Hi @ankbaner ,
Just wanted to check if you had the opportunity to review the information provide?.
If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Just wanted to check if you had the opportunity to review the information provide?.
If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @ankbaner ,
Just wanted to check if you had the opportunity to review the information provided by @rajendraongole1 .
If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @ankbaner ,
Just wanted to check if you had the opportunity to review the information provided by @rajendraongole1 .
If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @ankbaner -You're absolutely right to observe the discrepancy
TopN Net Sales =
VAR TopProducts =
TOPN(
3,
ADDCOLUMNS(
VALUES(Sales[ProductKey]),
"NetSales", CALCULATE(SUM(InternetSales[SalesAmount]))
),
[NetSales], DESC
)
RETURN
SUMX(
TopProducts,
[NetSales]
)
Hope this works.
Proud to be a Super User! | |
Hi,
Thank you for contributing to create solution. The given formula did not help to get the actual result. The outcome of the formula still shows difference compared to Top n Filter
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 62 | |
| 55 | |
| 39 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 93 | |
| 84 | |
| 33 | |
| 31 | |
| 25 |