Forum Discussion
`Power BI Stacked Graph
In this graph we are getting the percentage distribution as same but facing an error that the data labels number distribution is the same.
Hi arjun0028
Welcome to the Microsoft Fabric Community Forum.
Regarding the visualization of course enrolments with the Financial Year on the X-axis, Week of the Month as the legend, and enrolment counts on the Y-axis, the issue arises because the data labels are not reflecting the correct percentage distribution within each financial year.
This typically occurs when the DAX measure used does not properly account for the evaluation context of the visual.
Please try the following DAX measure:
Enrolment Percentage = DIVIDE( SUM('Booking Data'[Enrol_Count]), CALCULATE( SUM('Booking Data'[Enrol_Count]), REMOVEFILTERS('Booking Data'[Week of Month]) ) )
Create a chart with the X-axis representing the Financial Year, a legend indicating the Week of the Month, and values based on the new measure 'Enrolment Percentage'. Ensure that the data labels are configured to display either the percentage or the actual value as required.
If this response resolves your query, kindly mark it as Accepted Solution to help other community members. A Kudos is also appreciated if you found the response helpful.
Thank you for being part of Fabric Community Forum.
Regards,
Karpurapu D,
Microsoft Fabric Community Support Team.
7 Replies
- burakkaragozSuper User
Hi arjun0028 ,
This issue usually happens in Power BI stacked charts when the measure you use for the data labels isn’t being calculated in the right context. If all your data labels show the same value (or percentage), it’s likely that your DAX measure is not taking the correct axis values into account.How to fix:
- Make sure your measure uses the correct context. For percentage distribution, you can use something like this:
DAXPercentage = DIVIDE( COUNTROWS('YourTable'), CALCULATE(COUNTROWS('YourTable'), ALL('YourTable'[CategoryColumn])) )- Replace 'YourTable' and 'CategoryColumn' with your actual table and column names.
- Add this measure to your stacked column chart’s “Values” field and use it for data labels.
Extra tip:
If you want the percentage to show per stack, ensure your measure uses REMOVEFILTERS or ALL properly to calculate the total for each group.Let me know if you need a sample DAX formula for your exact scenario!
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
translation and formatting supported by AI- arjun0028Regular Visitor
In the graph I have taken Week of Month as Legend Financial Year on X axis and Enrol_Count on Y Axis
- arjun0028Regular Visitor
I would require a sample dax. I am trying to get Enrolment Percentage on a stacked column chart where the table is Booking Data and have column Enrol_Count.
- v-karpurapudCommunity Support
Hi arjun0028
Welcome to the Microsoft Fabric Community Forum.
Regarding the visualization of course enrolments with the Financial Year on the X-axis, Week of the Month as the legend, and enrolment counts on the Y-axis, the issue arises because the data labels are not reflecting the correct percentage distribution within each financial year.
This typically occurs when the DAX measure used does not properly account for the evaluation context of the visual.
Please try the following DAX measure:
Enrolment Percentage = DIVIDE( SUM('Booking Data'[Enrol_Count]), CALCULATE( SUM('Booking Data'[Enrol_Count]), REMOVEFILTERS('Booking Data'[Week of Month]) ) )
Create a chart with the X-axis representing the Financial Year, a legend indicating the Week of the Month, and values based on the new measure 'Enrolment Percentage'. Ensure that the data labels are configured to display either the percentage or the actual value as required.
If this response resolves your query, kindly mark it as Accepted Solution to help other community members. A Kudos is also appreciated if you found the response helpful.
Thank you for being part of Fabric Community Forum.
Regards,
Karpurapu D,
Microsoft Fabric Community Support Team.
- v-karpurapudCommunity Support
Hi arjun0028
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- v-karpurapudCommunity Support
Hi arjun0028
We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.
Thank You!
- v-karpurapudCommunity Support
Hi arjun0028
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.