Forum Discussion
Hi snusseri ,
If you are open to using the Blox Plugin, you can achieve the desired outcome by following these steps:
1. Create a Blox widget using the provided script:
{
"style": "",
"script": "",
"title": "",
"showCarousel": true,
"body": [
{
"spacing": "medium",
"type": "Container",
"items": [
{
"spacing": "small",
"type": "TextBlock",
"text": "Total Sales ",
"color": "default",
"horizontalAlignment": "center"
},
{
"type": "TextBlock",
"text": "{panel: Total Cost}",
"horizontalAlignment": "center",
"size": "extraLarge",
"style": {
"color": "#117899"
}
},
{
"type": "TextBlock",
"text": "Total sales in the Year: <b>{panel: YTD Cost}</b>",
"horizontalAlignment": "center",
"size": "medium",
"style": {
"color": "#000000",
"fontSize": "14px"
}
}
]
}
],
"actions": []
}
2. Include a date dimension under the Items panel, ensuring that the data level is set to 'Year'.
3. Add two measures under the Values panel. The first measure should use the actual formula, such as 'sum([Cost])'. For the second measure, use a formula like this: (ytdsum([Total Cost]), all([Quarters in Date]), ALL([Months in Date]), all([Days in Date]), all([Weeks in Date]))
. This setup ignores date filters at the Quarter, Month, Week, and Day levels, considering only the Year since it's specified in the Items panel.
Upon completion, your Blox should resemble something like this:
Feel free to reach out if you have further questions, we're always happy to help 🙂
[email protected]
Paldi Solutions