Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have the below measure, and it returns different figures based on a selected year, if the selected year value is zero(0), i want the zero(0) to be a hypen(-) instead of (0)
Amount on school kits = CALCULATE(SUM('master_indicators'[indicator_value]),'master_indicators'[indicator_key]="amt_sch_refurb")
Many thanks for the help.
Solved! Go to Solution.
To get something like this:
you launch the Tabular Editor and change the format of the measure (then save the changes to the model):
But for this to work, your measure must return 0, not BLANK, since BLANKS can't be formatted - they stand for the absence of a value. You should not format your measure with the FORMAT function because measures should always return the raw figure. If you do this, though, such a measure will not be able to be used by other measures since the value will not be a numeber - it'll be a string. Of course, you can turn a string into a number... but your code will become brittle, difficult to read and much slower.
By the way, when you launch Tabular Editor, just connect to the model in the file to be able to manipulate the structure. Tabular Editor can be found on GitHub (and there's a free version that will do in this case). The creator of this tool is Daniel Otykier.
Now it's up to you.
To get something like this:
you launch the Tabular Editor and change the format of the measure (then save the changes to the model):
But for this to work, your measure must return 0, not BLANK, since BLANKS can't be formatted - they stand for the absence of a value. You should not format your measure with the FORMAT function because measures should always return the raw figure. If you do this, though, such a measure will not be able to be used by other measures since the value will not be a numeber - it'll be a string. Of course, you can turn a string into a number... but your code will become brittle, difficult to read and much slower.
By the way, when you launch Tabular Editor, just connect to the model in the file to be able to manipulate the structure. Tabular Editor can be found on GitHub (and there's a free version that will do in this case). The creator of this tool is Daniel Otykier.
Now it's up to you.
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |