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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Icey
Community Support
Community Support

Hi @Anonymous ,

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
Icey
Community Support
Community Support

Hi @Anonymous ,

Sorry to reply late.

You can create your measures in any table. However, the new table "Concatenat" which is a slicer table need to be independent of other tables. If it is not independent of other tables, it will be affected by them when selected. The effect is called interaction.

 

Best Regards
Icey

Anonymous
Not applicable

Hi Icey,

Thank you. I couldn't reply from private message.

I've tried with sample to get values from different table but it doesn't work out from my side. Please see the below print screen. I think something wrong with my Power BI.

I've tried to create second column in same file (test832609) which you sent me the link but doesn't work out. 

 

Capture.PNG

Kind regards,

pv

Icey
Community Support
Community Support

Hi @Anonymous ,

You need to create a Table.

table.PNG

 

Best Regards,

Icey

Anonymous
Not applicable

Oh Sorry. I'm doing mistake here i.e., I'm creating new table from Enter data button from home tab instead of creating new table from modelling.

Thank you so much Icey. 

I hope won't distrub you again.

Kind regards,

pv

 

 

 
 

 

Icey
Community Support
Community Support

Hi @Anonymous ,

You are so welcome.

 

Best Regrads,

Icey

Anonymous
Not applicable

Ok thank you Icey.

Kind regards,

pv

Icey
Community Support
Community Support

Hi @Anonymous ,

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.

Anonymous
Not applicable

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

Icey
Community Support
Community Support

Hi @Anonymous ,

I am not very clear about the problem you describe. Please give me some screenshots.

 

Best Regards,

Icey

Anonymous
Not applicable

Hi Icey,

 

Thank you so much for your help and others as well.

Its really amazing and this forum is very helpful.

 

I was confusing before with your solution but I got clarity now because I'm looking for sum of defected but you have done count of measures. Sorry, its my mistake I should have told you before. I've created another sum of measures then I got the answer.

 

I got one more question please...

Can we create same measures in dCalendar table instead of doing another table like as you done?

 

Kind regards,

pv

 

Anonymous
Not applicable

Hi Icey,

 

Sorry. Its not 1667 because which you got old data and I did refresh the data file now, so it won't come 1667 for you but both charts value should get same.

Kind regards,

pv

Anonymous
Not applicable

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
 
Anonymous
Not applicable

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

Anonymous
Not applicable

Dear @Anonymous 

 

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

Anonymous
Not applicable

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

Anonymous
Not applicable

Dear @Anonymous 

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

Anonymous
Not applicable

Thank you Munna.  I'll check it.

 

Kind regards,

pv

Icey
Community Support
Community Support

Hi @Anonymous ,

 

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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