Forum Discussion
Creating a chart with several Columns (values 1, 0) into ONE Single Diagram
- 2 years ago
If you unpivot the disease columns, the data will be easier to visualize. In Power Query, select the disease columns and select Unpivot Columns:
Rename columns as desired:
Dear DataInsights ,
this worked perfectly, thanks a lot!
In some cases same subject had multiple diseases, so now that I filtered 1 in "disease present", there are multiples the subject records as well (e.g., patient ID = 18 has two lines, one for each of the two diseases). Do you maybe know if there is a way to prevent this duplication, but still showing the disease seperatelly?
As this also duplicates the other parameters the subjects have, that should be displayed one per subject anyway.
thanks a lot!
Dovile
- DataInsights2 years ago
Super User
- djankuna2 years agoFrequent Visitor
Hi,
Yes. Unpivot solution created duplicate records in my dataset. Example ID 93, same subject but 2 lines for each of the disease condition:
now for other graphs this information has been displayed several times as well (e.g., gender --> 2x female). So in case i would need to tell how many females are included, this will not be 100 % accurate.
is there any way to show all the results as per ID, but still keep the unpivot for disease column?
93:
regards,
Dovile
- DataInsights2 years ago
Super User
You could create a measure using DISTINCTCOUNT like this:
Count Subject = DISTINCTCOUNT ( 'Table'[Subject] )