Karl Anka
Karl Anka

Reputation: 2849

Adding sample data for Power BI questions

When asking for help with Power BI, what is the best way to add sample data to the question?

What is the best way to show the relationship between tables?

Upvotes: 2

Views: 80

Answers (3)

Mike Honey
Mike Honey

Reputation: 15017

For sample data in a PBIX file, the easiest way is using the Enter Data feature. You can copy in rows & columns from Excel etc, but the data is self-contained within the PBIX file.

Upvotes: 0

Alexis Olson
Alexis Olson

Reputation: 40204

If the sample data is fairly limited in scope, you should type post it as copyable tables similar to this:

Date      ID   Value
1/2/2018  101  A
1/8/2018  102  B
1/9/2018  101  B

If the tables and relationships are fairly large and/or complex, then a link to a PBIX file helps us reproduce the issue much more quickly.


The relationships are probably best shown as a screenshot of the Relationships tab from the desktop app. Please also write what columns the relationships are on if it's not clear.

Relationship Diatram

Upvotes: 3

Karl Anka
Karl Anka

Reputation: 2849

Regarding how to add sample data the most simple way is in my opinion to use a DAX table constructor.

Depending on if you are on a non-American or American machine semicolon (;) is used as separator instead of colon (,), while colon is used as a decimal separator in non-American and dot (.) in American.

American:

    {
        (1.5, DATE(2017, 1, 1), CURRENCY(199.99), "A"),
        (2.5, DATE(2017, 1, 2), CURRENCY(249.99), "B"), 
        (3.5, DATE(2017, 1, 3), CURRENCY(299.99), "C") 
    }

Non-american:

    { 
        (1.5; DATE(2017; 1; 1); CURRENCY(199.99); "A"); 
        (2.5; DATE(2017; 1; 2); CURRENCY(249.99); "B"); 
        (3.5; DATE(2017; 1; 3); CURRENCY(299.99); "C") 
    }

Then it is easy to add this data to a model by just using the New Table-function under the Modeling-tab.

[how to add the data[1]

And simply pasting the data there.

enter image description here

The downside of this way is that the columns will be named Value1 Value2... ValueN. If this is a big issue one could use DAX DATATABLE in basically the same way as described above.

Upvotes: 0

Related Questions