Forum Discussion
ankbaner
1 year agoRegular Visitor
TOPN DAX function Issue
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...
- 1 year ago
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.