问题
I have a PowerBI Report showing columns of figures representing hours of support we've sold by customer. Those figures are calculated in PowerBI by men.
But some customers haven't bought any support - so I want to show those columns for those customers as blank, not zero.
I can do this easily by turning the whole column to text, rather than numeric, and the blank fields can just be "". But users want to be able to export the visual and have the numbers be numbers (not text) when it gets to Excel.
Is there any way I can have 0 values show as blank in this case?
回答1:
I'm not sure how you've set up your data and what you'd really like to do with it. But until we get some clarifications here's is my take on it:
Some sample data:
Hours,Customer
1,AA
2,BB
2,CC
0,DD
4,EE
If you import that data using Get Data
and activate the Power Query Editor
, you can right-click Hours
, select Replace Values
and replace 0
with null
to get this:
Click Close&Apply
to get back to the desktop and select a Clustered Column Chart
. Assign Customer
to Axis
and Hours
to Values
so that you get this:
As you can see, DD
is not there, which I believe is how you'd like to illustrate your data. But now you can also click Customer
under VISUALIZATIONS > Axis
and select
Show items with no data
:
And you'll get this:
If you now select Export Data
you'll get a txt file with all the customers, but with no data for customer DD
that originally had the value 0
:
Please let me know if this is not what you were looking for.
来源:https://stackoverflow.com/questions/52527341/powerbi-replace-zeros-with-blanks