deneb-viz / deneb

Deneb is a custom visual for Microsoft Power BI, which allows developers to use the declarative JSON syntax of the Vega or Vega-Lite languages to create their own data visualizations.
https://deneb-viz.github.io
MIT License
193 stars 15 forks source link

Option to include totals in DAX query results #342

Closed bdarbonneau closed 5 months ago

bdarbonneau commented 1 year ago

I am using the Deneb visual to create a formatted matrix for an P&L statement: Accoung groups on Y axis, Business lines on X axis. Currently, the DAX query that the visual generates does not return the totals, and I have to workaround this limitation by adding a dummy 'Total' business line in the dimension table of the model, and modify the agg measure to return the unfiltered value when this dummy value is in the context.

Would it be possible to make it an option to include the totals in the query that Deneb sends to the data model ? This would allow adding totals calculated by the model (sum is not always the appropriate agg function ) to the visual dataset without the hack described above.

dm-p commented 1 year ago

Unfortunately, we have no control over the DAX that gets executed by Power BI; we only get the dataset based on the fields added to the visual dataset by the report creator.

If you want the totals, the approach for this would typically be to add further marks that are either aggregates of the data in the field encodings or aggregate transforms in a dedicated layer for this purpose.

If you need further help with the necessary language constructs to do this, I'd suggest posting your question on one of the public locations recommended on Deneb's support page, as this is where folk who are in a position to assist typically hang out.

dm-p commented 5 months ago

Closing due to lack of activity. If you need further language assistance, I recommend approaching one of the community support representatives via one of their preferred channels.