Forum Discussion
Parameter slider to remove bars higher than selected value
- 2 years ago
Hi PowerBI-Newbie
Create a measure that says:
Show or Hide measure =
If( [SrStatusCalculation] > SelectedValue(table[srStatusSliderMax]), BLANK(), [SrStatusCalculation] )
Use BLANK if you want the column to disappear or 0 to keep the column but show empty. - 2 years ago
Oh that is awesome, I will be making more videos but got side tracked by having children 😂
The measure will effectively replace the Y axis calculation, so something like this:
If( COUNT(Issues[Incident Date]) > [MaxChart All Faults Count - All], BLANK(), COUNT(Issues[Incident Date]) )Let me know how you get on 🙂
Also if you didn't know we have full free video courses you can watch!
Hi SamWiseOwl ,
Sorry to bother you. How do I take the user selection of certain columns into account? So still using the following measures:
Y-Axis Maximum:
All Faults Count - All Status Y-Axis = IF( ([All Faults Count - All]) > [MaxStatusSlider Value], 0, ([All Faults Count - All] ))
MaxStatusSlider Value (Parameter measure):
MaxStatusSlider Value = SELECTEDVALUE('MaxStatusSlider'[MaxStatusSlider], [MaxChart Overall Failure Status All Faults Count - All])
Fault Count Measure:
MaxChart All Faults Count - All =
CALCULATE(
MAXX(
ADDCOLUMNS(DISTINCT(ALL(Issues[Year:Period],Issues[Status])),"AllCount",[All Faults Count - All]),[AllCount])*1.1,
All(Issues)
)
So the user may select a particular date period or filter by category so what do I need to change within the measure(s) above to ensure the Y-Axis measure updates accordingly?
Hi PowerBI-Newbie the only thing I see that would be preventing it from changing is the ALL.
All removes internal AND external filters.
AllSelected only removes internal ones (external filters like slicers, filter pane, drillthrough will be kept).
Or AllExcept to remove all filters except the ones on columns you specify.
- PowerBI-Newbie2 years agoHelper IV
Hi SamWiseOwl ,
This may sound like a stupid question but which ALL do I change into AllSelected/AllExcept?
- SamWiseOwl2 years agoSuper User
This bit:
ALL(Issues[Year:Period],Issues[Status])
Is making sure that all your years and Status are included in the AddColumn, that is making a mini table and for each row working out:[All Faults Count - All]. Do you want to include all the years and status in this mini table?
This one: All(Issues)
is removing every filter on the entire table, not just those two columns. This means you are doing the MAX calculation and including every value.
Put AllSelected on which ever one you want to keep external filters for. Do you want everything included in the [AllCount] measure or do you only want the ones choosen in the slicer.
- PowerBI-Newbie2 years agoHelper IV
Hi SamWiseOwl ,
This is the graph that I need to have:
The X-Axis is the column Type from the table Issues and Y-Axis is the measure that I mentioned previously. So the X-Axis calculates the number of faults per Type taking into account the external filters/slicers that are applied by the user, one of them being Year:Period (single selection slicer). When I've been playing with the measure to see what effect it's having on the graph, I noticed that the Y-Axis Max is much more than 18.7 (17 x 1.1) - some of the changes that I made is causing it to be in the hundreds and some in the thousands hence my request for assistance as I don't know what I'm doing.
Some of the other graphs that I want to apply this to have a hierarchical X-Axis (Sub-Type and Type columns for example), how will this affect the way the measure should be written?