Forum Discussion
acarter02
Dec 12, 2021Copper Contributor
Pivot Table and Chart, Percentages, and calculated field
Hello all - I'm struggling with setting up a pivot table to create a pivot chart. My data has age group and number of ER visits. Then I have to create a new field that assigns a 1 if the number...
HansVogelaar
Dec 12, 2021MVP
Does this do what you want?
acarter02
Dec 12, 2021Copper Contributor
Thank you for the response. Yes that might work. I can see that you made the "0" series No Line. I'm wondering if it makes more sense to make the Has ER Visit a calculated field. Does the hint that is provided make sense to you? (The average of a 0-1 column is a percent).
- SergeiBaklanDec 12, 2021Diamond Contributor
You didn't mention on which version of Excel. If data model is available I'd work with it.
You may use measure
Has ER Visit, %:=VAR allVisits = COUNTROWS ( Range ) VAR ERvisits = CALCULATE ( COUNTROWS ( Range ), Range[Has ER Visit] = 1 ) RETURN DIVIDE ( ERvisits, allVisits )
to build chart like