Forum Discussion
Not Displaying Values on Chart
Sure. So instead of a car count, you would want to use a measure like this:
PercentageSold = COUNTROWS(DealerData)/CALCULATE(COUNTROWS(DealerData),ALLSELECTED(DealerData))
Go to the Modeling tab, select this measure and format it as a percentage. Then you can use this as the field instead of the Count of MonthOfSale.
What's happening is that we're using COUNTROWS(DealerData) to count all the cars currently in context, with the context being a specific MonthOfSale from the column of the chart, as well as Dealer and Date filters.
Then it's dividing that by another count of rows, however I'm using CALCULATE syntax to change the context. ALLSELECTED is a cool pre-set filter context that returns all rows that are used in the current visual. The visual is trying to display all the data that respects your slicers, so this is an easy way to just count all of those rows quickly instead of mucking about with ALLEXCEPT or explicitly naming each field you want to keep in FILTER(ALL(table), field1=SELECTEDVALUE(field1)....) style syntax.
Hope this helps!
hi Cmcmahan
Thanks again for your help , but this didnt work for me.
The measure you gave me calculated the percentages right including null , but as soon as I either apply a filter to exclude null or I add a slicer to filter it out , the percentage values changes as it is excluding the null (unsold) cars from the calulcation. I basically need the percetnages to be calculated using the null values , but for the null value percentage to not appear on the chart. Not sure where to go with this.