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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Lookup value in Matrix

Hi everyone,

 

I have a problem to do calculation by using Matrix. 

test.PNG

Column: Reporting Date (i.e. March 2, 2020 -- 2)

Row: All rows are calculated from Tables

Table 1: Claim Info. - One claim one line(including Reporting date, Examiner name, Claim #,Claim amount etc.)

Table 2: Daliy Target Lookup 


Capture.PNG
Currently, my calculation is to create one column in Table 1 ---- Assign Target to each claim (each line) based on Date and Examiner name. Then, sum target for each line and divided by number of reporting days.

This menthod is good if the target for each day is the same. But, I have problem to calculate the total target for the month if the daily targets are not the same in different days. 

 

I am thinking if I can assign daliy target to each reporting day with claims processed directly in Matrix, instead to each line in Table 1, all issues could be solved. But, I dont know how to do the calculation. Could you please help me? Or, anyone may have better idea?

 

Thanks in advance

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a sample to test:

30.PNG31.PNG

Then please try this measure:

Measure = 
VAR CountOfPerDay =
    CALCULATE (
        COUNT ( 'Table 1'[Reporting Date] ),
        FILTER (
            ALLSELECTED ( 'Table 1' ),
            'Table 1'[Examiner name] IN FILTERS ( 'Table 1'[Examiner name] )
                && 'Table 1'[Reporting date] IN FILTERS ( 'Table 1'[Reporting date] )
        )
    )
RETURN
    CALCULATE (
        SUM ( 'Table 2'[Target] ),
        FILTER (
            ALLSELECTED ( 'Table 2' ),
            'Table 2'[Examiner] IN FILTERS ( 'Table 1'[Examiner name] )
                && 'Table 2'[Reporting Date] = MAX ( 'Table 1'[Reporting date] )
        )
    ) / CountOfPerDay

The result shows the assigned target value for each line per day:

32.PNG
Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

 

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a sample to test:

30.PNG31.PNG

Then please try this measure:

Measure = 
VAR CountOfPerDay =
    CALCULATE (
        COUNT ( 'Table 1'[Reporting Date] ),
        FILTER (
            ALLSELECTED ( 'Table 1' ),
            'Table 1'[Examiner name] IN FILTERS ( 'Table 1'[Examiner name] )
                && 'Table 1'[Reporting date] IN FILTERS ( 'Table 1'[Reporting date] )
        )
    )
RETURN
    CALCULATE (
        SUM ( 'Table 2'[Target] ),
        FILTER (
            ALLSELECTED ( 'Table 2' ),
            'Table 2'[Examiner] IN FILTERS ( 'Table 1'[Examiner name] )
                && 'Table 2'[Reporting Date] = MAX ( 'Table 1'[Reporting date] )
        )
    ) / CountOfPerDay

The result shows the assigned target value for each line per day:

32.PNG
Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

 

amitchandak
Super User
Super User

@Anonymous 

You can create common dimensions/tables like examiner and date and join  them you both tables and use those two to analyze data

 

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
Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors