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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.