We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I have a matrix visualization in power bi. There are 'Dept' in the Rows and 'Year' in the column. And we have 'CountID' in the Values. Now a matrix is being created. There are a total of 8 Dept but only 7 are being shown in visualization becasue the eighth Dept, i.e. Law, does't have any CountID. What i want is to show the Law Dept as well even without any value.
You can refer to the folloiwng solution
Sample data
1.Create a Dept table to contain the eight departments
2.Create a year table
3.Then create a measure
Measure =
VAR a =
SUMMARIZE (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] <> BLANK () ),
[Dept]
)
RETURN
IF (
SELECTEDVALUE ( Dept[Dept] ) IN a,
MAXX (
FILTER (
'Table',
[Dept]
IN VALUES ( Dept[Dept] )
&& [Year] IN VALUES ( 'Year'[Year] )
),
[Column1]
),
0
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @devesh_gupta ,
Thanks for your reply. I tried this solution but I cannot use CountID in a new measure as CountID itself is a self created Measure.
@asad-mustafa-dc Can we try like this if it works for you:
CountIDOrZero = IF(ISBLANK([CountID]), 0, [CountID])
@devesh_gupta No it's giving same results as before. It's not showing 0 as values where no CountID exists.
@asad-mustafa-dc Let's try these simpe steps:
Select the matrix visual.
On the Fields pane, locate the "Dept" field under the Rows section.
Click on the dropdown arrow next to the "Dept" field to open its context menu.
Check the option that says "Show items with no data." This option will ensure that all departments, even those without any CountID values, are displayed in your matrix visual.
If you find this insightful, please provide a Kudo and accept this as a solution.
@asad-mustafa-dc Community support has provided some solution above to this problem... Have you tried if that's working or not?
@asad-mustafa-dc You can create a new measure like this:
CountIDOrZero = IF(ISBLANK(SUM(YourTableName[CountID])), 0, SUM(YourTableName[CountID]))Drag this measure into the values field. This should force Power BI to display all departments, including Law, even if it doesn't have any CountID values. The measure will return 0 for Law in this case.
If you find this insightful, please provide a Kudo and accept this as a solution.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |