Forum Discussion
Can't display the visual
Hi Anonymous,
Thanks for your response.
My DAX-formula represents different values/content. Maybe it was badly formulated, but it looks kinda like this:
StandardizedName =
SWITCH(
TRUE(),
'Connection Table'[Name] = "alternative name of a sub-department1", "regular name for sub-department1",
'Connection Table'[Name] = "alternative name of a sub-department2", "regular name for sub-department2",
'Connection Table'[Name] = "alternative name of a sub-department3", "regular name for sub-department3",
'Connection Table'[Name] // Default Case
)
I hope this makes sense. All three instances are different departments.
| Name | DepartmentNumber | Group | StandardizedName | StandardizedDepartmentNumber |
| Department1 | 10001 | Main-department1 | Department1 | 10001 |
| Department2 | 10002 | Main-department2 | Department2 | 10002 |
| Department3 | 10002 | Main-department2 | Department3 | 10002 |
| Department4 | 10002 | Main-department2 | Department2 | 10002 |
| Department5 | 10003 | Main-department3 | Department5 | 10003 |
| Department6 | 10003 | Main-department3 | Department6 | 10003 |
| Department7 | 10003 | Main-department3 | Department5 | 10003 |
| Department8 | 10003 | Main-department3 | Department6 | 10003 |
| Department9 | 10004 | Main-department4 | Department9 | 10004 |
This is what my Connection Table looks like. The reason for "StandardizedName" is because three of the departments are being called with another name in their specific dataset, but is actually the same. For example Department4 should be under the same name as Department2 in my slicer, since it is the same department. I hope this makes sense. Why I have StandardizedDepartmentNumber, I'm not really sure now that I look at it, since it just replicates DepartmentNumbers. I hope this makes sense.
When I now choose Group - Main-Department2 from my slicer it has the sub-choices Department2 and Department3. For some reason, whether I choose Main-Department2, or just one of the two, Department2 or 3, I am only able to have my visual displayed if data is registered in all of the last 12 months for example. If there is a month withoung registrered data I get the error 'Couldn't load the data for this visual - unable to convert a value to the data type requested for table "column'. If I choose a main-department which has data registered in all of the last 12 months, no problem at all. It only occurs when there is missing data. All of my columns are formatted as "Text" and I've tried changing the DepartmentNumbers to another Data Type, but no difference. Now to the relatioships. My Connection Table is connected to the "Name" column, where name is DepartmentNumbers, in the Overall Department Table, which has data for all departments. This relationship is a Many-to-Many with a Both in Cross Filter Direction. I have experimented here as well, nothing seems to work. And then the "Overall Department Table - Name" column is connected to the "Owning Department" (this is again also department numbers) column in my "QualityManagement" table which contains all the data for this specific visual. This is a Many-to-One relationship with Single Cross Filter Direction (arrow pointing towards "QualityManagement"). I cannot change in this relationship as it is greyed out. And of course my "QualityMangament" table is connected to a Date table. Really looking forward to your answer!!
Hi, Anonymous
In Power BI, missing data can lead to visualization errors. You can use DAX functions such as IF or COALESCE to handle missing values.
You can refer to the following DAX:
StandardizedName =
SWITCH(
TRUE(),
'Connection Table'[Name] = "alternative name of a sub-department1", "regular name for sub-department1",
'Connection Table'[Name] = "alternative name of a sub-department2", "regular name for sub-department2",
'Connection Table'[Name] = "alternative name of a sub-department3", "regular name for sub-department3",
COALESCE('Connection Table'[Name], "Unknown") // Default Case
)
You should also try to avoid many-to-many relationships. You can try to change the relationship between Connection Table and Overall Department Table to one-to-many. If you cannot change it directly, consider creating an intermediate table to simplify the relationship.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years agoNot applicable
Thank you for your time and respone Anonymous . It doesn't seem to work. Could the issue be related to that I have duplicates in my department numbers column in my Connection Table?