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
dragon_prince
Frequent Visitor

Lookup the Quarter value from another table

I have two tables, Snapshot Table and Close Date table. I want to pull the Snapshot data, its arr and then for the same quarter, all the matching values of arr in close date table. 
Please help me in this!

Input      
Snapshot_dateAccount_idArr Close_DateAccount_idArr
Mar-201210 Mar-20128
Mar-20342 Apr-20345
May-20157 May-20153
May-20169 Jun-20162
Aug-20117 Aug-20111
Aug-20107 Sep-201013
Nov-20147 Nov-20147
Nov-20137 Nov-201344
       
Output      
Monthsnapshot_arrclosed_arr    
Mar-20128    
May-20163    
Aug-20141    
Nov-201451    
3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

How you arrived at the numbers in the snapshot_arr column of the output table?  Give a proper explanation.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FreemanZ
Super User
Super User

hi @dragon_prince 

you may create a calculated table like this:

Table = 
VAR _table1 =
SELECTCOLUMNS(
    INTERSECT(VALUES(Close_Date[Close_Date]), VALUES(Snapshot[Snapshot_date])),
    "Date", Close_Date[Close_Date]
)
RETURN
ADDCOLUMNS(
    SUMMARIZE(_table1, [Date]),
    "snapshot_arr",
    VAR _date = [Date]
    RETURN
    SUMX(
        FILTER(
            ALL(Snapshot),
            Snapshot[Snapshot_date] = _date
        ),
        Snapshot[Arr]
    ),
    "closedate_arr",
    VAR _date = [Date]
    RETURN
    SUMX(
        FILTER(
            ALL(Close_Date),
           Close_Date[Close_date] = _date
        ),
       Close_Date[Arr]
    )
)

 

verified with your sample data and worked like this:

FreemanZ_0-1674660586117.png

dragon_prince
Frequent Visitor

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.