Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
Novice here. With an issue in how to show data in a certain way.
Effectively, we are attempting to visualise two or three columns, that have a number within relating to a specific name held in two separate columns. However the name can either be under the name1 or name2 column. This is the challenge we are facing.
We want to get the rows with "a" within it to report out on visualisations without including anything that doesn’t have "a" in it. Here is some dummy data. We also want to see each line individually and have been using the matrix visual which works well except it will only show the data from either Name1 or Name2, and now showing us both. Using splicers to narrow the certain name.
Name1 | Name2 | Name1 Number | Name2 Number |
a | b | 10 | 20 |
a | c | 10 | 30 |
a | d | 30 | 10 |
a | b | 10 | 20 |
b | a | 40 | 10 |
b | a | 50 | 10 |
c | a | 60 | 30 |
b | d | 40 | 20 |
c | e | 40 | 10 |
I have attempted to do a calculated column, which is the below: And it unfortunately just adds up the total of the line with "a" in it.
if [Name1]="a" or [Name2]="a" then [Name1 Number]+[Name2 Number] else 0
Any assistance would be greatly appreciated.
Thanks
Solved! Go to Solution.
Hi @ShaunBizSol,
You can also use DAX like below. You can check attached .pbix file.
Table = UNION(SELECTCOLUMNS('Table1',"Name1",'Table1'[Name1],"Value1",'Table1'[Name1 Number]),SELECTCOLUMNS('Table1',"Name2",'Table1'[Name2],"Value1",'Table1'[Name2 Number]))
Best Regards,
Qiuyun Yu
Hi @ShaunBizSol,
You can also use DAX like below. You can check attached .pbix file.
Table = UNION(SELECTCOLUMNS('Table1',"Name1",'Table1'[Name1],"Value1",'Table1'[Name1 Number]),SELECTCOLUMNS('Table1',"Name2",'Table1'[Name2],"Value1",'Table1'[Name2 Number]))
Best Regards,
Qiuyun Yu
You are a life savor. I have applied this to our actual data set, added a few additional columns and its working perfectly.
Thank you very much for your help
Shaun
I think what you need to do is to create 3 queries. The first query imports Name1 and Name 1 Number only and I would add an Index. The second query imports Name 2 and Name 2 Number only and also add an Index. Then create an append query to append them together.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |