Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
Is there a way within a line and stacked column chart to hide some of the data (in this case, the bars) so I'm only showing the oldest and the latest data points
Here's what I have
Here's what I'd like to achieve
Any help would be appreciated.
Thanks
Solved! Go to Solution.
Hi, @aaronvincentnz ;
Such as Pragati11 said, however One thing is different, what I'm establishing here is the values of the earliest and latest dates.
Measure =
var _max=CALCULATE(MAX('financials'[Date]),ALL(financials))
var _min=CALCULATE(min('financials'[Date]),ALL(financials))
return CALCULATE(SUM(financials[ Sales]),FILTER('financials',[Date] in {_max,_min}))
Then change the data label.(close line's label and retain column's)
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
managed to get it to work. thanks all
Hi, @aaronvincentnz ;
Try it.
Measure =
var _max=EOMONTH( CALCULATE(MAX('financials'[Date]),ALLSELECTED(financials)),0)
var _min=EOMONTH(_max,-13)
return CALCULATE(SUM(financials[ Sales]),FILTER('financials', EOMONTH([Date],0) in {_max,_min}))
The final show:
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @aaronvincentnz ;
Such as Pragati11 said, however One thing is different, what I'm establishing here is the values of the earliest and latest dates.
Measure =
var _max=CALCULATE(MAX('financials'[Date]),ALL(financials))
var _min=CALCULATE(min('financials'[Date]),ALL(financials))
return CALCULATE(SUM(financials[ Sales]),FILTER('financials',[Date] in {_max,_min}))
Then change the data label.(close line's label and retain column's)
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the above. It partially worked....
HI @aaronvincentnz ,
This can be achieved by a little hack in Power BI. There can be multiple ways of achieving this, but this is what I found out as a solution to this problem.
Consider the following example chart:
Now in this chart, I want to display bars for only MIN and MAX sales value but the line should be there for everything.
I created a following DAX measures.
Max sales & Min sales measures for sales. I want my sales to change with YEAR column therefore an ALLEXCEPT is used. You can ignore it in your case.
# Max Sales = MAXX(ALLEXCEPT(Sales, Sales[Year]), [# Total Sales])
# Min Sales = MINX(ALLEXCEPT(Sales, Sales[Year]), [# Total Sales])
# Sales Dynamic display Max Min Bars =
IF(
[# Total Sales] = [# Max Sales] || [# Total Sales] = [# Min Sales] , "#118DFF", // show BLUE color for the bars
"#FFFFFF" // show WHITE color for bars (this should be your visual background color)
)
Now I go to my visual formatting settings and use this measure for formatting on bars:
After hitting ok I get the desired result:
Now the chart shows lines for all the points, but the bars for only min and max values.
The trick here is to give your other bars on the chart same color as your visual background by using the measure calculation.
Let me know if this solution helps.
User | Count |
---|---|
107 | |
87 | |
81 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |