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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
anileshknpowerb
Helper III
Helper III

How to show duplicate records in Table visual in Direct Query mode

Hello experts,

 

I have below data in database. I am using Direct Query mode. When I build a table visual, it shows me only one record as the values are same in all 3 rows. I want to show all 3 rows in table visual. How to do this?

 

Data:

Name  Customer   Score     Revenue

A            Cust1        50            1000

A            Cust1        50            1000

A            Cust1        50            1000

 

Current o/p:

Name  Customer   Score     Revenue

A            Cust1        50            1000

 

Expected o/p:

Name  Customer   Score     Revenue

A            Cust1        50            1000

A            Cust1        50            1000

A            Cust1        50            1000

 

Thanks,

Anilesh

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

Hi, @anileshknpowerb 

The function to get a random number in Power BI is Rand() and Randsbetween(). However, they both don’t support Direct query mode. The step that adds a random column in the Power query also doesn’t support Direct query mode. Then I figure out a method that used the calculated table to achieve this, you can follow my steps:

  1. Create a calculated table:
Table = ADDCOLUMNS('Table_2',"Tag",RAND())
  1. Create a table and place the columns in the new table, like this:

v-robertq-msft_0-1608533023678.png

 

  1. Change the field color of [Tag] to white, as I did before:

v-robertq-msft_1-1608533023687.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

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

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, @anileshknpowerb 

The function to get a random number in Power BI is Rand() and Randsbetween(). However, they both don’t support Direct query mode. The step that adds a random column in the Power query also doesn’t support Direct query mode. Then I figure out a method that used the calculated table to achieve this, you can follow my steps:

  1. Create a calculated table:
Table = ADDCOLUMNS('Table_2',"Tag",RAND())
  1. Create a table and place the columns in the new table, like this:

v-robertq-msft_0-1608533023678.png

 

  1. Change the field color of [Tag] to white, as I did before:

v-robertq-msft_1-1608533023687.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-robertq-msft
Community Support
Community Support

Hi, @anileshknpowerb 

According to your description, you want to make the three columns that are exactly the same to display their own value in the table chart through direct query mode, you can try my steps:

  1. Create a calculated column in the data table:
Tag = RAND()
  1. Create a table chart and place columns like this, then set the summarize type of [Tag] to “Don’t summarize”:

v-robertq-msft_0-1608279627984.png

 

  1. Then you can set it like this to make the [Tag] column disappear in your table chart:

v-robertq-msft_1-1608279627991.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I tried to create a DAX column 'Tag' Looks like,in Direct Query we can't create DAX column with value RAND()

Tag=RAND(). I get beloe error.

 

anileshknpowerb_0-1608308766135.png

 

amitchandak
Super User
Super User

@anileshknpowerb , Create a new column

sum(Table[Revenue]) + Rand() 

or

sumX(Table, Table[Revenue]) + Rand() )

and try. Other wise I doubt you can show.

You need add some unique column

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.