Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe'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
Hello,
I'm trying to create a card using Deneb, the card should contain a Measure representing total revenue added as Text, and below it a bar chart that breaks the revenue by month.
I have created the bar chart with no problem, but when I add the Text Mark and add the measure to it, it is added to the chart as data points (which is not what I want)
This is my code:
{
"data": {"name": "dataset"},
"layer": [
{
"mark": {
"type": "bar",
"tooltip": true
},
"encoding": {
"x": {
"field": "Year Month short",
"type": "nominal",
"axis": null
},
"y": {
"field": "Revenue",
"type": "quantitative",
"title": null,
"axis": null
},
"color": {"value": "gray"}
}
}
]
}And this is the result
Desired result
Your help is so much appreciated.
Best regards,
Simon
Solved! Go to Solution.
I found the solution, it was very simple actually
"encoding": {
"text": {
"aggregate": "sum",
"field": "Revenue",
"type": "quantitative",
"format": "#,##,,.00M;(#,##,,.00M)",
"formatType": "pbiFormat"
}
}It was this part of the code that aggregated the data points:
"aggregate": "sum"
A sample PBIX file can be found here:
https://cloud.degoo.com/share/OFPTR5znFMEcezYqdXK_RQ
I found the solution, it was very simple actually
"encoding": {
"text": {
"aggregate": "sum",
"field": "Revenue",
"type": "quantitative",
"format": "#,##,,.00M;(#,##,,.00M)",
"formatType": "pbiFormat"
}
}It was this part of the code that aggregated the data points:
"aggregate": "sum"
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.