The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Dear DAX community,
I would like to have a visual that has conditional hiearchy in one of the x axes. The example I give is a line graph, showing sales for 4 calendar years of data, with the last year broken down into quarters. Is such a visualization possible without hard coding a column that contains those exact values?
The solution I have right now is that I can write a calculated column in my date table that will show calendar year for all years that are not the latest, then break down by quarter for the latest. The problem with this is that in an axis, the spacing between the quarters will be equal to the spacing between years, which can be misleading. Sketch of what I want is shown below.
Solved! Go to Solution.
Thanks for the reply from @lbendlin , please allow me to provide another insight:
Hi @DAX_merchant ,
Create a quarter column and add it to the x-axis. Refer to the following:
qur_ =
IF (
YEAR ( Table_[Date] ) < 2023,
BLANK (),
SWITCH ( QUARTER ( Table_[Date] ), 1, "Q1", 2, "Q2", 3, "Q3", 4, "Q4" )
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from @lbendlin , please allow me to provide another insight:
Hi @DAX_merchant ,
Create a quarter column and add it to the x-axis. Refer to the following:
qur_ =
IF (
YEAR ( Table_[Date] ) < 2023,
BLANK (),
SWITCH ( QUARTER ( Table_[Date] ), 1, "Q1", 2, "Q2", 3, "Q3", 4, "Q4" )
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This will work. It maintains the hierarchical look which is nice. Still, the expansion does not maintain relative tick size in relation to actual time, but that seems to be impossible.
Why not use the standard axis hierarchy, with expand and collapse?
I have tried, but not found a way to expand only one year, and have that persist throughout the opening of the report once it is published. This seems leverage drill down which to my understanding can only do one of two things: expand all, or expand one and stop showing the others. If there is a way to expand one year while keeping the others as years, that would be nice.
If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41