Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi ,
My requirement is dynamically switch between different demographic categories using the slicer, display their proportions over time on the line chart, and add a reference line to show the gap for the selected category. I would like to see two lines one for young and one for muture with year on x axis, parameter on Legend and Proportion on Y axis. I have created the table parameter for all the demographics categories lets say for example:
Solved! Go to Solution.
Hi @Anonymous
I have tested your problem and your code seems to be fine. The key to the problem lies in the creation of visual objects.
I suggest you create two visual objects that show the data corresponding to different parameters.
Select "Gender"
Select "Age"
Select "line chart", "Year" in the x axis, "SelectedCategoryProportion" into the y axis.
It should be noted that "Gender" and "Age" are placed into the "Small multiples" of the two visual objects respectively.
At the same time, you can adjust the visual object to two rows and one column.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
I have tested your problem and your code seems to be fine. The key to the problem lies in the creation of visual objects.
I suggest you create two visual objects that show the data corresponding to different parameters.
Select "Gender"
Select "Age"
Select "line chart", "Year" in the x axis, "SelectedCategoryProportion" into the y axis.
It should be noted that "Gender" and "Age" are placed into the "Small multiples" of the two visual objects respectively.
At the same time, you can adjust the visual object to two rows and one column.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you provide some sample data or pbix file? The cause cannot be determined because the model and context are not clear.
Thanks for looking into this. Please below table for your rererence:
Age | Gender | Proportion | Year | Gap age | YoungProportion | MatureProportion | MaleProportion | FemaleProportion |
Mature | Female | 7.20% | 2015/16 | 8.60% | 0.157723577 | 0.071726893 | 0.080260304 | 0.071726893 |
Mature | Male | 8.00% | 2015/16 | 8.80% | 0.168731563 | 0.080260304 | 0.080260304 | 0.071726893 |
Mature | Female | 8.40% | 2016/17 | 8.50% | 0.16861167 | 0.083595922 | 0.07884097 | 0.083595922 |
Mature | Male | 7.90% | 2016/17 | 8.60% | 0.165222415 | 0.07884097 | 0.07884097 | 0.083595922 |
Mature | Other | 0.00% | 2016/17 | 0.00% | 0 | 0 | 0.07884097 | 0.083595922 |
Young | Female | 15.80% | 2015/16 | 8.60% | 0.157723577 | 0.071726893 | 0.168731563 | 0.157723577 |
Young | Male | 16.90% | 2015/16 | 8.80% | 0.168731563 | 0.080260304 | 0.168731563 | 0.157723577 |
Young | Female | 16.90% | 2016/17 | 8.50% | 0.16861167 | 0.083595922 | 0.165222415 | 0.16861167 |
Young | Male | 16.50% | 2016/17 | 8.60% | 0.165222415 | 0.07884097 | 0.165222415 | 0.16861167 |
Young | Other | 0.00% | 2016/17 | 0.00% | 0 | 0 | 0.165222415 | 0.16861167 |
Thanks for looking into this. Please below table for your rererence:
Age | Gender | Proportion | Year | Gap age | YoungProportion | MatureProportion | MaleProportion | FemaleProportion |
Mature | Female | 7.20% | 2015/16 | 8.60% | 0.157723577 | 0.071726893 | 0.080260304 | 0.071726893 |
Mature | Male | 8.00% | 2015/16 | 8.80% | 0.168731563 | 0.080260304 | 0.080260304 | 0.071726893 |
Mature | Female | 8.40% | 2016/17 | 8.50% | 0.16861167 | 0.083595922 | 0.07884097 | 0.083595922 |
Mature | Male | 7.90% | 2016/17 | 8.60% | 0.165222415 | 0.07884097 | 0.07884097 | 0.083595922 |
Mature | Other | 0.00% | 2016/17 | 0.00% | 0 | 0 | 0.07884097 | 0.083595922 |
Young | Female | 15.80% | 2015/16 | 8.60% | 0.157723577 | 0.071726893 | 0.168731563 | 0.157723577 |
Young | Male | 16.90% | 2015/16 | 8.80% | 0.168731563 | 0.080260304 | 0.168731563 | 0.157723577 |
Young | Female | 16.90% | 2016/17 | 8.50% | 0.16861167 | 0.083595922 | 0.165222415 | 0.16861167 |
Young | Male | 16.50% | 2016/17 | 8.60% | 0.165222415 | 0.07884097 | 0.165222415 | 0.16861167 |
Young | Other | 0.00% | 2016/17 | 0.00% | 0 | 0 | 0.165222415 | 0.16861167 |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
15 | |
13 | |
11 | |
9 | |
8 |