Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi @all
I got a requirement from my client that to create a hierarchical time series chart and visualize time-based data across different levels of granularity.
Below is the sample data
| Date | Region | Country | City | Sales Amount |
|------------|---------|----------|---------|--------------|
| 2024-01-01 | North | USA | New York| 1000 |
| 2024-01-01 | South | USA | Miami | 1500 |
| 2024-02-01 | North | USA | New York| 1100 |
| 2024-02-01 | South | USA | Miami | 1600 |
The requirement is a line chart with Date in the x-axis and sales amount in Y-axis, and there will be another column called "agg_hierarchy", if the user selects agg_hierarchy =1, then the line chart should have 2 lines North and south for region within Country "USA", in the same way if the user selects agg_hierarchy =2, then the line chart should have 2 lines for city within country "USA" So on..
As per my knowledge, In Power BI, hierarchical dimensions cannot be directly added to the "Legend" field well in the time series charts.
so reaching to you all, if anyone have any alternatives to implement the same. Kindly suggest.
Thanks in advance.
Solved! Go to Solution.
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi, @BI_USER6
Regarding the issue you raised, my solution is as follows:
1.First, create a new parameter value and add the required columns:
2.Next, modify the parameters as follows and use them as slicers
Parameter = {
(" 1 ", NAMEOF('cc'[ Region ]), 0),
(" 2 ", NAMEOF('cc'[ City ]), 1)
}
3.Next, modify the visualization as follows:
4.Here's the end result that hopefully meets your needs:
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
One alternative is to use Field Parameters.
Hi @lbendlin
Thanks for the solution.
Field parameters will works on individual dimensions, I need to display timeseries for a country along with all the regions within the selected country.
Thanks for the reply from lbendlin please allow me to provide another insight:
Hi, @BI_USER6
Excuse me, whether his answer has solved your problem, and if so, please accept his reply as a solution.
If you find a workaround yourself,share your solution and accept it as a solution that will help other community members who have the same problem as you.
Best Regards,
Leroy Lu
Hi @Anonymous ,
Thank you for your response. Unfortunately, the solution provided by Ibendlin has not fully resolved the issue I am experiencing.
Could you please offer further assistance or suggest an alternative approach? I appreciate your help in addressing this matter.
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi, @BI_USER6
Regarding the issue you raised, my solution is as follows:
1.First, create a new parameter value and add the required columns:
2.Next, modify the parameters as follows and use them as slicers
Parameter = {
(" 1 ", NAMEOF('cc'[ Region ]), 0),
(" 2 ", NAMEOF('cc'[ City ]), 1)
}
3.Next, modify the visualization as follows:
4.Here's the end result that hopefully meets your needs:
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
How would that graphically look like? Showing the same data twice in the same visual is a design red flag.