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
Dear All,
I have created Line and clustered column chart vistual
I want to show the Data labels for the Y-Axis based on conditions (only for the selected month data) for other month only line should be there.
I have attached pbix and excel for your reference.
Excel: https://toyotsu.box.com/s/wbkdanpgs96h5g2ktzxfn0qssbokb18v
Pbix: https://toyotsu.box.com/s/89e0wmc1ng9944zt5j9ocqvwvwtclqkd
Solved! Go to Solution.
Hi @NadeemAhamed ,
Please create these new measures:
Actual Cumulative Data Labels =
VAR __slicer = ALLSELECTED('Month'[Month])
VAR __cur_month = SELECTEDVALUE('Monthly'[Monthly])
VAR __result = IF(__cur_month IN __slicer, SUM('Sheet1'[Actual Cumulative]))
RETURN
__result
Plan Cumulative Data Labels =
VAR __slicer = ALLSELECTED('Month'[Month])
VAR __cur_month = SELECTEDVALUE('Monthly'[Monthly])
VAR __result = IF(__cur_month IN __slicer, SUM('Sheet1'[Plan Cumulative]))
RETURN
__result
And then please apply it to the data label's value:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi @NadeemAhamed ,
Please create these new measures:
Actual Cumulative Data Labels =
VAR __slicer = ALLSELECTED('Month'[Month])
VAR __cur_month = SELECTEDVALUE('Monthly'[Monthly])
VAR __result = IF(__cur_month IN __slicer, SUM('Sheet1'[Actual Cumulative]))
RETURN
__result
Plan Cumulative Data Labels =
VAR __slicer = ALLSELECTED('Month'[Month])
VAR __cur_month = SELECTEDVALUE('Monthly'[Monthly])
VAR __result = IF(__cur_month IN __slicer, SUM('Sheet1'[Plan Cumulative]))
RETURN
__result
And then please apply it to the data label's value:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
@Anonymous
Thank you for your solution.
Its working.
To show data labels for the Y-Axis based on conditions (only for the selected month data) in a Line and Clustered Column Chart visual, you can use a combination of measures and conditional formatting.
Here's a general approach you can follow:
Create Measures: Create measures for the data you want to display as data labels. You can use DAX functions like IF, SWITCH, or SELECTEDVALUE to conditionally show data labels based on your criteria.
Add Measures to Data Labels: Add your measures to the "Data labels" section of your visual. This will display the data labels for each data point on the chart.
Apply Conditional Formatting: Use conditional formatting on your measures to control when the data labels should be displayed. You can use DAX functions within the measures to determine if the data labels should be shown for the selected month or not.
Here's an example of how you might set up your measures:
Replace 'YourDateTable'[Month] with the column reference to your date/month field, and [YourMeasure] with the measure you want to display as the data label.
Once you have your measures set up, add them to the "Data labels" section of your Line and Clustered Column Chart visual. Then, apply conditional formatting to control when the data labels should be displayed based on your criteria.
By following these steps, you should be able to achieve the desired behavior of showing data labels for the Y-Axis based on conditions for the selected month data in your visual.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Dear @johnbasha33
Thank you for your valuable time to read and reply my query.
I have tried this above method but it will show only selected values in line but line are missing for the other month.
I have updated the same pbix file for your reference.