Forum Discussion
Stacked Column X Axis
- 7 years ago
Hey,
just create a new table, that contains all the possible values.
Create a relationship between the new table (on the one side) and your existing table (on the many side), this article explains how to create relationships: https://docs.microsoft.com/en-us/power-bi/desktop-create-and-manage-relationships
Use the column from the new table as axis, and make sure you enable this option "Show items with no data":
Hopefully this provides what you are looking for.
Regards,
Tom
If you click the dropdown arrow on your axis field (Expiration in your case) you should see an option to Display Items with no data. Selecting this will show you the expected blanks for month 3 & month 4.
After that, it's all about ordering your graph by X-Axis category. It should be easy to get 1-7 months in order, with expired after 7, since that's alphabetical order. If you want expired first, you'll need to set up an ordering column that indicates what order the categories should be sorted in and use that.
Hey Cmcmahan ,
I assume that the current data does not contain the "missing" values, fo this reason I suggested to create a "dimension" table, we will see ...
Regards,
Tom
- Cmcmahan7 years agoResident Rockstar
You're right TomMartens. Good catch.
Since these categories are treated as text by the Power BI engine, it is unaware that it should make a "3 months" and a "4 months" category on its own. The benefit of creating the new table that lists each of the possible category options is that you can set up an index column and sort by that to get the desired order of categories on the X-Axis.