Forum Discussion
TOPN function doesn't allow me to quote a table
Hi, I try to create a topn measure to get the sum of of top 5 KPI achievement %, however, it looks like the TOPN function doesn't allow me to quote a table. Usually after typing the ' sign (see below), Power BI will give me a list of tables, but nothing comes out with topn function here. I also get a warning of syntax error if I try to input table name manually.
Any help will be highly appreciated.
topn = calculate([total kpi], topn(5,'
8 Replies
- v-juanli-msftCommunity Support
Hi Anonymous
As tested, it works on my side.
Measure = CALCULATE(SUM([value]),TOPN(5,Table1,[value]))
or
Measure = CALCULATE(SUM([value]),TOPN(5,'Table1',[value])) or Measure = CALCULATE(SUM([value]),TOPN(5,ALL(Table1),[value]))Please share a simple data for me to test.
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Thank you for the prompt feedback. I suspect the issue may relate to my computer language setup or power bi version. Is there a way for me the send you the data and topn function as an attachment rather than a printscreen?
- v-juanli-msftCommunity Support
Hi Anonymous
My pbix
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-juanli-msftCommunity Support
Hi Anonymous
I have no access to your file, please upload it to One drive and share the link here.
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Thank you for follow up. I can not share the file with you via onedrive. I have a company account, which doesn't allow me to share onedrive file with people outside the organization.