Forum Discussion
Repleacing blank() with zeros
I was wrong. thank you for you patience.
example:
i have two filter dimension: Machine Type, Machines (1:* relationship)
Table ("Machine" is from Machines table, filtred by MachineType table)
results:
I need 0's in all other colums for Drill01, WB01, WB04, WB08, WB12 machines
so if i change measure for Scraps of All %
from measure:
Scraps of All %:= DIVIDE( [Scraps], [All])
to measure:
Scraps of All %:= COALESCE(DIVIDE( [Scraps], [All]), 0)
(thank you for COALESCE)
result is:
i need a table only with Machines by MachineType filter (not in red square)
- edhans6 years ago
Community Champion
I'm sorry Anonymous - I cannot help. There is no MachineType field in the image so I cannot help you construct a filter based on a field I cannot see or know what is in it. You have to understand I have no idea what your model looks like or your data, beyond your screenshots. You have to provide specific and detailed info.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum- Anonymous6 years agoNot applicable
edhans
of cource. thank youmaybe this help:
all measures:
Production:= SUM( Production[ProducedParts] )
Scraps:= SUM( Scrap[pocet] )
All:= [Total Production] + [Total Scraps]
Scraps of All %:= DIVIDE( [Scraps], [All] )
Production of All%:= DIVIDE( [Production], [All] )
model:* MachineCodebook = Machines (from my examples)
I have put MachineType fied to table. now a see its wrong. By why 🤔
- edhans6 years ago
Community Champion
Anonymous Check out this article on how DAX handles blanks. A number plus a blank = that number, but when you divide with a blank, it returns a blank, not a zero.
You can show/hide items with "no data" which is a blank, using the column setting I gave earlier in a screenshot, or you can cause blanks to return as zero using COALESCE as mentioned before. In its simplest form:
Measure = COALESCE([Some Other Measure], 0)That will return 0 if the [Some Other Measure] returns a blank.