Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I created a table using the matrix visual. My values are sums of number of records in a field (named 'Faculty Rank' and once I drag that field under values, I choose the Count option). I want to replace the blanks in the matrix with '0' but cannot find any posts on this besides creating a new column in Query editor to the data source. However, because these are counts of the field and I am creating over 100 frequency tables using over 20 fields, I figured there's an easier way to do this?
Solved! Go to Solution.
Hi @elopez ,
Based on my research, If your table does not have at least one row record in the blank cell (such as our following example), the measure will not calculate at all:
We can use a separated table such as following to meet your requirement
Calculated Table:
Column = DISTINCT('Table'[Column])
Measure:
Measure Value = CALCULATE([Measure]+0,'Table'[Column] in DISTINCT('Column'[Column]))
By the way, PBIX file as attached.
Best regards,
Hi @elopez
I would suggest to create a new column with the following DAX function to replace the blank values:
New Column = IF( Old Column = BLANK(), "0", Old Column)
You can then choose the New Column in the Matrix visual.
If this does not work, I would suggest you share some screenshots 🙂
I am new to power BI so maybe i did this wrong? I: clicked the table-->New measure-->wrote in what's in the screenshot-->dragged the newly created 'number of faculty' measure to my values field. but then the table couldn't be displayed (the table is very similar to the 2nd table below it. i want to replace all the blank values with '0'
so i created the measure and named it number of faculty (from your first message). then i dragged that to the values section. is this correct and the problem is the string type?
Wait, is that measure you are pointing to what is being used in your current table visualization? If that is the case:
Measure = IF(ISBLANK([your current measure name]),0,[your current measure name])
Can you click on See details and tell us what it says?
based on your 2nd message, i am unsure if i need to change what i wrote in the original measure?
Hi @elopez ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Hi @elopez ,
Based on my research, If your table does not have at least one row record in the blank cell (such as our following example), the measure will not calculate at all:
We can use a separated table such as following to meet your requirement
Calculated Table:
Column = DISTINCT('Table'[Column])
Measure:
Measure Value = CALCULATE([Measure]+0,'Table'[Column] in DISTINCT('Column'[Column]))
By the way, PBIX file as attached.
Best regards,
I tried it and it doesn't do anything:
can not say without looking at data and formula.
But Typically we add + 0 to the formula to deal with it
Measure = calculate(<Formula>) +0
or Coalesce( calculate(<Formula>),0)
or Coalesce( calculate(<Formula>),0) +0
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |