Forum Discussion
How to set default value to the table when there is no data existing at all?
- 4 years ago
Okay, to answer to myself, I think I got this.
I did test this out and created a separated table for the default values like this:
vw_defaultloadingplaces = {
(1, "LOADING PLACE 1", 0, 0, DATEVALUE(TODAY())),
(2, "LOADING PLACE 2", 0, 0, DATEVALUE(TODAY())),
(3, "LOADING PLACE 3", 0, 0, DATEVALUE(TODAY())),
(4, "LOADING PLACE 4", 0, 0, DATEVALUE(TODAY())),
(5, "LOADING PLACE 5", 0, 0, DATEVALUE(TODAY())),
(6, "LOADING PLACE 6", 0, 0, DATEVALUE(TODAY())),
(7, "LOADING PLACE 7", 0, 0, DATEVALUE(TODAY()))
}
Then I built up a visual based on this table. At first I though I need to create measures to sum those 0 values with Amounts etc. but it actually seem to work without doing so too (since loadingdate is filtered with relative date is this date and loading place names are identical and connected using manage relationships).
So now I got the table visual which does show the 0 values too.
There's certain relationships I need to create in order to make it fully compatible with the existing data (different unit types mess it up etc), but this actually was a working solution for it.
Thanks anyway!Hopefully this helps someone else with similar challenge someday. 🙂
(sorry, I managed to delete my own solution since it was under this one, what a confusing forum)
Next issue is that totals are messed up and I am not completely sure why. I would understand if Power Bi would gather all the historical data regarding the amounts (per Loading place), but it is impossible since amount is way too low for it but at the same time it's wayyy too much since total amounts is only approx. 6,4% of the totals shown in visual.
Is there any bullet-proof ways to calculate only the values shown in visual? I tend to have this issue fairly often.