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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Making a visual that pulls data from two tables

Hi, I want to use a visual to show the projected and actual sales of a product by quarter such as in Table C. My data sources would be Table A and B. I am new to powerBI and would be really grateful if anyone is able to help. Thank you.

 

Table A    
ProductProduct IDSales DateStock DateCategory
A126899/5/20204/5/20201
B785636/5/20205/29/20202
D876541/24/20204/22/20204
C768783/21/20203/25/20203
C768786/21/20209/12/20203
D876542/5/20202/24/20204
A126891/15/20202/23/20201
A1268912/7/202012/9/20201
B785639/29/20204/14/20202
C7687810/2/20207/12/20203
C768786/25/20202/25/20203
D876544/3/20209/9/20204
D8765411/25/20206/7/20204
C768782/24/20202/19/20203
A126894/5/20206/9/20201
B785632/26/202012/17/20202
B785633/16/20208/29/20202
.....
.....
.....
C768784/22/202010/12/20203

 

Table B  
ProductQuarterProjected
AQ110
AQ220
AQ310
AQ424
BQ134
BQ220
BQ310
BQ420
CQ123
CQ25
CQ315
CQ418
DQ117
DQ215
DQ330
DQ425

 

Output

Table C  
ProductQuarterProjectedActual
AQ11010
AQ22025
AQ31012
AQ42424
BQ13434
BQ22021
BQ31017
BQ42018
CQ12324
CQ256
CQ3157
CQ41823
DQ11716
DQ21513
DQ33035
DQ42526
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Try this, use the first three columns in tableB

Then create this measure

Actual =
CALCULATE (
    COUNTROWS ( 'Table A' ),
    FILTER (
        ALL ( 'Table A' ),
        'Table A'[Product] = MIN ( 'Table B'[Product] )
            && QUARTER ( 'Table A'[Sales Date] )
                = VALUE ( RIGHT ( MIN ( 'Table B'[Quarter] ), 1 ) )
    )
)

Result

vxiaotang_0-1652165897103.png

 

vxiaotang_1-1652165897105.png

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Try this, use the first three columns in tableB

Then create this measure

Actual =
CALCULATE (
    COUNTROWS ( 'Table A' ),
    FILTER (
        ALL ( 'Table A' ),
        'Table A'[Product] = MIN ( 'Table B'[Product] )
            && QUARTER ( 'Table A'[Sales Date] )
                = VALUE ( RIGHT ( MIN ( 'Table B'[Quarter] ), 1 ) )
    )
)

Result

vxiaotang_0-1652165897103.png

 

vxiaotang_1-1652165897105.png

 

Best Regards,

Community Support Team _Tang

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

amitchandak
Super User
Super User

@Anonymous , In table one you can create Qtr based on any of the date

 

example

c

 

Then you can create a combine key and join both tables

 

Key = [Product] & "-" [QTR]

 

you can not get data in visual together

 

do in Power Query , new columns

="Q"& Number.ToText(Date.QuarterOfYear([sales Date]))

 

In both tables

"Q"& Number.ToText(Date.QuarterOfYear([sales Date]))

 

 

merge two tables

 


Append and merge : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.