We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi all,
I am a newby and tried the VAR Function. Has anyone an idea, why it doesnt work?
Thanks a lot
Martin
Solved! Go to Solution.
Hi @Rupilas,
It looks like you're commenting everything out. When you use an comment operator everything after the operator becomes a comment. Try using /* to open and */ to close the comment instead.
Sales Summary =
VAR SalesTableWithCustKey = Filter(/* Filter Table */ 'Fact Sale', /* Filter Condition */ 'Fact Sale'[Customer Key]>0)
VAR SalesTableGrouped = SUMMARIZE(/* Table to Summarize */ 'SalesTableWithCustKey','Fact Sale'[Customer Key],/* Aggregated Colum Name Expression */ "Total Spend", SUM('Fact Sale'[Total Including Tax])
VAR SummaryTableFiltered = TOPN(/* Numbers of rows to return */ 10, /* Table to filter */ SalesTableGrouped, /* Order by Expression */ [Total Spend])
RETURN SummaryTableFiltered
Proud to be a Super User!
Hi @Rupilas,
It looks like you're commenting everything out. When you use an comment operator everything after the operator becomes a comment. Try using /* to open and */ to close the comment instead.
Sales Summary =
VAR SalesTableWithCustKey = Filter(/* Filter Table */ 'Fact Sale', /* Filter Condition */ 'Fact Sale'[Customer Key]>0)
VAR SalesTableGrouped = SUMMARIZE(/* Table to Summarize */ 'SalesTableWithCustKey','Fact Sale'[Customer Key],/* Aggregated Colum Name Expression */ "Total Spend", SUM('Fact Sale'[Total Including Tax])
VAR SummaryTableFiltered = TOPN(/* Numbers of rows to return */ 10, /* Table to filter */ SalesTableGrouped, /* Order by Expression */ [Total Spend])
RETURN SummaryTableFiltered
Proud to be a Super User!
Hi Watsky,
many thanks for the quick answer
Somehow it still doesnt work.
Now I tried to do it without comments when I start to write VAR3 then it is red underlined and doesnt work.
Could you have another look?
Now I solved it It was one bracket too much, Many thanks to you!!!!
Happy to Help! Glad you're good to go now.
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 33 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 40 | |
| 34 | |
| 25 |