Imagine you have in your Obsidian note two YAML fields:
You want to use a Dataview block to generate a table about information on your progress. You can simply display the values, and calculate the progress in percentage. But you can also add a beautiful visualization for your progress: display a progress bar.
When you set up your progress bar, you must consider these two parts:
The actual progress bar is defined by two values:
To define these values, you use this formula in the Dataview block:
```
"<progress max=" + target + " value=" + value + "> </progress> "
```
To define the label to add, you simply calculate the value of the progress:
```
round(value/target*100) + "%"
```
In our case, we can have this entire dataview formula:
```dataview
table without id
file.link as "Example",
value as "Value",
target as "Target",
round(value / target * 100)+"%" as "Advancement",
"<progress max=" + target + " value=" + value + "> </progress> "
+ round(value/target*100) + "%" as "Progress"
from #task
where file.name=this.file.name
```
An here is what you can have, if the target value is equal to 15, and the actual value of completed task is equal to: 5 :
One more thing to consider, is that you must ensure that your properties fields are of type number. If it is not the case, you will have to use in the formula the number convert method, to convert them to numbers.