Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ShaunBizSol
Frequent Visitor

Same data in two columns. Need to visualise values within a table referencing the same name.

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

 

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

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

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

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

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Greg_Deckler
Community Champion
Community Champion

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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors