Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap
Hi
I created a simple 2 column table on my powerbi desktop using "Table" in the visualizations.
I dragged in a measure column [ sale_date ] and a dimension column [widgets].
The dimension column I just want to get the sum of the whole column.
I cant use powerquery due to security reasons, so all I have is powerbi desktop and I want to hopefully create a measure using DAX so I can take the sum of [widgets] column and make it available via a measure, so I can graph the answer.
When I try to do a =sum(<table.[column]) I cant seem to get it to work.
I'm strugging to understand whats wrong as Ive been given this task, but not a lot of training.
Any help would be really appreciated. 🙂
Solved! Go to Solution.
Hi @wokka ,
If you're working in Power BI Desktop and pulling data from a semantic model (such as a published dataset or Analysis Services), then your ability to write DAX measures depends on whether you're allowed to extend the model. If you're in a pure live connection mode, Power BI won’t let you create new measures unless you're using DirectQuery for Power BI datasets (composite models). If that’s enabled, click “Make changes to this model” when prompted, and you’ll be able to create a new measure.
To create a DAX measure that sums the [Widgets] column, you can write:
Total Widgets = SUM('YourTableName'[Widgets])
Replace 'YourTableName' with the actual name of your table in the model. If [Widgets] is already a measure and not a raw column, don’t try to wrap it in SUM() again—just use it directly. If your model doesn’t support adding measures, you won’t see the option to create one, and you’ll need to enable composite model mode via File > Options > Preview features > DirectQuery for Power BI datasets and restart Power BI. Once done, you can add your own measures and use them in visuals like any other field.
Best regards,
Hi @wokka ,
Since I didnt hear back from you I am assuming you are still facing the issue.
I would encourage you check the data type-
Make sure [widgets] is a numeric column. If it’s text, sum() will not work.
If thats already a numeric field, and still you encounter an error, can you share more information about the issue like-the error details, data source, type of connection?
So that it we be easy for us to resolve the issue.
Thank You
If this post helps, please give us Kudos and consider marking it Accept as solution to assist other members in finding it more easily.
Hi @wokka ,
Just wanted to check if you had the opportunity to review the suggestion provided?
If the 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 @wokka ,
If you're working in Power BI Desktop and pulling data from a semantic model (such as a published dataset or Analysis Services), then your ability to write DAX measures depends on whether you're allowed to extend the model. If you're in a pure live connection mode, Power BI won’t let you create new measures unless you're using DirectQuery for Power BI datasets (composite models). If that’s enabled, click “Make changes to this model” when prompted, and you’ll be able to create a new measure.
To create a DAX measure that sums the [Widgets] column, you can write:
Total Widgets = SUM('YourTableName'[Widgets])
Replace 'YourTableName' with the actual name of your table in the model. If [Widgets] is already a measure and not a raw column, don’t try to wrap it in SUM() again—just use it directly. If your model doesn’t support adding measures, you won’t see the option to create one, and you’ll need to enable composite model mode via File > Options > Preview features > DirectQuery for Power BI datasets and restart Power BI. Once done, you can add your own measures and use them in visuals like any other field.
Best regards,
User | Count |
---|---|
19 | |
18 | |
16 | |
13 | |
13 |
User | Count |
---|---|
10 | |
8 | |
8 | |
7 | |
6 |