Forum Discussion
Thulasiraman
3 years agoHelper II
Summarize error
Hi I have created a SUMMARIZE Dax which shows the error which I could not understand. Pls help Thulasiraman
Thulasiraman
3 years agoHelper II
Hi MahyarTF
Created the above TOPN dax.
Tested the Summarize portion and it creates a valid table.
But when nested in TOPN it shows the error.
Appreciate very much if you could be able to find the error I am committing.
FreemanZ
3 years agoSuper User
Same issue: TOPN returns a list/table. When creating a measure, the outmost function shall be someone returning a value (or a one-row-one-column table), like SUM, MIN/MAX/AVERAGE, COUNTROWS, MINX/MAXX, etc.
try like:
measure = CALCULATE( SUM[tbl[Value]], TOPN(...))
What is your ultimate goal of this measure?
- Thulasiraman3 years agoHelper II
Hi FreemanZ
Thanks for your continued support and clarifications.
I have successfully created a table using the summarize function.
Sum Table = SUMMARIZE('Itemwise DC All', 'Itemwise DC All'[Dye Item], "cost", SUM('Itemwise DC All'[Tally amt]))Now this table contains 2 columns 1) the name of the item (dye item) and 2) the amount (tally amt) column called 'cost'I want to find the Top N of the above item based on the cost.I tried using the calculate function as below which is not giving the desired result:TOPN = CALCULATE(SUM(sum table[cost]), TOPN(3, sum table, SUM(sum table[cost])It gives the total values against all the items.Once again thanks for your patient explanations.