The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi Power BI Community,
I’ve created a line chart that dynamically switches between different growth metrics for Sales Units and Sales Price. I’ve implemented this using calculation groups, and it’s working great.
Here’s how it’s set up:
I have two slicers/buttons:
When I select a measure (either Units or Sales Price), the line chart below updates to reflect the selected growth metric (Monthly, YoY, or MAT growth) for the chosen measure. Both slicers/buttons are aligned, ensuring the chart displays the correct data based on the selected options.
Issue:
I would like to enhance the chart by adding two additional lines that highlight the maximum and minimum growth values for the selected metrics. These lines should dynamically update based on the current measure (Units or Sale Price) and the selected growth metric (Monthly, YoY, or MAT Growth).
Additional Information:
I'll be providing the link of PBIX file which I've created using the Contoso Sales Data sample. On the first page, I’m showcasing what I’ve achieved so far with dynamic measure selection. On the second page, I’m illustrating what I’m aiming to accomplish—specifically, displaying monthly growth with the highest and lowest values highlighted.
I’m looking for guidance on how to achieve this within Power BI. Any suggestions or step-by-step instructions would be greatly appreciated!
Download the PBIX File here !
Thank you in advance!
I need a help in Chart please !
@Shahabh786 Have you looked at the Analytics pane?
Thanks for the suggestion!
Yes, I’ve explored the Analytics pane, but the challenge I encountered is that it provides a straight line for the max and min values. What I’m aiming for is to highlight the specific months or years where these max and min growth values occur with two distinct points, rather than a continuous line.
To achieve this, I believe using a measure would be more flexible. This way, I can dynamically calculate and display the min and max values for the selected metrics, and also apply additional insights if needed in the future. This approach would give me more control over the visualization, allowing the chart to reflect these values accurately in the context of the selected growth metric and measure.
Would appreciate any guidance on how to create such measures or if you have any other suggestions!
Thanks again for your help!
@Shahabh786 Well, in that case you could have the measure return a value for the min/max and blank for everything else and then perhaps turn on a marker for that line series. I didn't download your PBIX file but you could do something like this:
Min Measure =
VAR __Measure = [Original Measure]
VAR __Table = SUMMARIZE( ALL('Table'), [Year], [Month], "__Value", [Original Measure] )
VAR __Min = MINX( __Table, [__Value] )
VAR __Result = IF( __Measure = __Min, __Measure, BLANK() )
RETURN
__Result
User | Count |
---|---|
65 | |
62 | |
59 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |