cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Get data from table 2

Hi Guys,

I hope you can help me. I'm new to the Power BI.

 

Table 1: Data from Mar 19 - till date

Table 2: Data from Jan 19 - Feb 19

Table 3: Calendar table

 

I would like to get the data from table 2 as well when I select month name from Calendar table. I've created relationship but it doesn't work out for table 2. Please help me.

 

pv_powerbi_1-1572441414322.png

 

Kind regards,

pv

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Get data from table 2

Hi @pv_powerbi ,

Your column chart's x-axis and y-axis are both from Table 1, not Table 2. So, it will show blank when you choose "January" or "February". 

Try this:

1. Create measures. Please pay attention to your blank values in "Concatenate". Not blank, but "   ".

 

Count of Defected data =
IF (
    MAX ( 'Data Collection'[Concatenate] ) = "   ",
    BLANK (),
    COUNT ( 'Data Collection'[Concatenate] )
)
Count of defected =
IF (
    MAX ( 'dCollection(Jan-Feb)'[Concatenate] ) <> "   ",
    COUNT ( 'dCollection(Jan-Feb)'[Concatenate] )
)
Defected all =
IF (
    ISBLANK ( MAX ( 'Concatenate'[Concatenate] ) ),
    BLANK (),
    [Count of defected] + [Count of Defected data]
)

 

2. Create a table.

 

Concatenate =
FILTER (
    VALUES ( 'Data Collection'[Concatenate] ),
    'Data Collection'[Concatenate] <> "   "
)

 

column3.PNG

3. Create a column chart.

column1.PNGcolumn2.PNG

 

PBIX file attached.

 

Best Regards,
Icey

 

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

18 REPLIES 18
Highlighted
Helper I
Helper I

Re: Get data from table 2

Dear @pv_powerbi 

 

I'm trying to understand that from the table 2,

what columns/measures do you want to display in the report 

If using single measures between table 1 and table2 then create the calculated measures from 2 tables

 

Regards, 

 

Munna

Highlighted
Advocate I
Advocate I

Re: Get data from table 2

Hi,
I am not sure about the solution but i have a workaround you can try as of now.

Create a measure:

Measure = IF(
SELECTEDVALUE('Date'[Date]) = SELECTEDVALUE('Table'[Date]) ||
SELECTEDVALUE('Date'[Date]) = SELECTEDVALUE('Table (2)'[Date]),
1,
0
)
 
Put this in table visual and also on visual level filter, select value 1 and apply.
 
Thanks,
Vinay Dandwani
 
Highlighted
Frequent Visitor

Re: Get data from table 2

Dear vijaykolisetty,

Thank you so much for the reply. 

I've created measures. I hope you can understand after see the below print screen. I don't understand one more thing here, I created relationship with date column for three tables and if select column from one table then automatically show linked table (highlighted with tick mark for table in the left corner) but it doesn't show that.

 

I'm thinking my table relationship is wrong. Is that right?

 

pv_powerbi_0-1572449484815.png

Kind regards,

pv

Highlighted
Frequent Visitor

Re: Get data from table 2

Hi Vinay,

 

Thank you so much for the reply.

 

I think your formula is correct but I'm not getting, it says can't display. Sorry, I think I'm doing something wrong.

 

Kind regards,

pv

Highlighted
Helper I
Helper I

Re: Get data from table 2

Dear @pv_powerbi 

Thank you for the screenshot, in this case there are 2 possibilities 

1. To check the relationships or change the relationship type into bi-directional

2. Check the data type of the date or change the date column into date format and test the data.

 

Regards, 

Munna

Highlighted
Frequent Visitor

Re: Get data from table 2

Thank you Munna.  I'll check it.

 

Kind regards,

pv

Highlighted
Community Support
Community Support

Re: Get data from table 2

Hi @pv_powerbi ,

 

Is this problem solved?

 

If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know. And it would be great if you could share me your PBIX file without sensitive information.


Best Regards
Icey

Highlighted
Community Support
Community Support

Re: Get data from table 2

Hi @pv_powerbi ,

Your column chart's x-axis and y-axis are both from Table 1, not Table 2. So, it will show blank when you choose "January" or "February". 

Try this:

1. Create measures. Please pay attention to your blank values in "Concatenate". Not blank, but "   ".

 

Count of Defected data =
IF (
    MAX ( 'Data Collection'[Concatenate] ) = "   ",
    BLANK (),
    COUNT ( 'Data Collection'[Concatenate] )
)
Count of defected =
IF (
    MAX ( 'dCollection(Jan-Feb)'[Concatenate] ) <> "   ",
    COUNT ( 'dCollection(Jan-Feb)'[Concatenate] )
)
Defected all =
IF (
    ISBLANK ( MAX ( 'Concatenate'[Concatenate] ) ),
    BLANK (),
    [Count of defected] + [Count of Defected data]
)

 

2. Create a table.

 

Concatenate =
FILTER (
    VALUES ( 'Data Collection'[Concatenate] ),
    'Data Collection'[Concatenate] <> "   "
)

 

column3.PNG

3. Create a column chart.

column1.PNGcolumn2.PNG

 

PBIX file attached.

 

Best Regards,
Icey

 

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

Highlighted
Frequent Visitor

Re: Get data from table 2

Hi Icey,

 

Thanks for the solution. 

 

If I select by line 100 then it should get around 1667 but it showing too many like ten thousands in bar charts.

 

And also once I select by line 100 then both charts should get same values not different.

 

Could you please recheck why its showing. Sorry to trouble you.

 

Kind regards,

pv

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors