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

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

Reply
Dizzy
Frequent Visitor

Get First Value on Matrix

Dear all,

 

I'm currenty working on issue to get only first value on Marix within Month, I used Firstnonblankvalue but I get the result without month, as you can see below I want to get only the yellow values:

 

Dizzy_0-1713261217731.png

Best regrads

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @tamerj1 , please allow me to provide another insight: 

Hi  @Dizzy ,

I created some data:

vyangliumsft_0-1713335679602.png

 

Here are the steps you can follow:

1. Create measure.

 

Measure =
var _date=
MINX(
    FILTER(ALL('Table'),
    'Table'[Account Number Name CRM]=MAX('Table'[Account Number Name CRM])&&
    'Table'[Month_Year]=MAX('Table'[Month_Year])&&
    'Table'[Value]<>BLANK()),[Date])
return
SUMX(
    FILTER(ALL('Table'),
    'Table'[Account Number Name CRM]=MAX('Table'[Account Number Name CRM])&&
    'Table'[Month_Year]=MAX('Table'[Month_Year])&&
    'Table'[Date]=_date),[Value])

 

2. Result:

vyangliumsft_1-1713335679605.png

 

Best Regards,

Liu Yang

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

6 REPLIES 6
tamerj1
Super User
Super User

Hi @Dizzy 
Following the sample file created by @Anonymous, please try the following

1.png

Measure = 
SUMX ( 
    SUMMARIZE ( 'Table', 'Table'[Account Number Name CRM], 'Table'[Month_Year] ),
    VAR CurrentMonth =
        'Table'[Month_Year]
    VAR CurrentAccountTable = 
        FILTER ( 
            CALCULATETABLE ( 
                'Table',
                ALLEXCEPT ( 'Table', 'Table'[Account Number Name CRM] )
            ), 
            'Table'[Value] <> BLANK ( ) 
        )
    VAR FirstRecord = 
        TOPN ( 1, CurrentAccountTable, 'Table'[Date], ASC )
    VAR FirstMonth = 
        MAXX ( FirstRecord, 'Table'[Month_Year]  )
    VAR FirstValue = 
        MAXX ( FirstRecord, 'Table'[Value] )
    RETURN 
        IF ( CurrentMonth = FirstMonth, FirstValue )
)

 

 

Anonymous
Not applicable

Thanks for the reply from @tamerj1 , please allow me to provide another insight: 

Hi  @Dizzy ,

I created some data:

vyangliumsft_0-1713335679602.png

 

Here are the steps you can follow:

1. Create measure.

 

Measure =
var _date=
MINX(
    FILTER(ALL('Table'),
    'Table'[Account Number Name CRM]=MAX('Table'[Account Number Name CRM])&&
    'Table'[Month_Year]=MAX('Table'[Month_Year])&&
    'Table'[Value]<>BLANK()),[Date])
return
SUMX(
    FILTER(ALL('Table'),
    'Table'[Account Number Name CRM]=MAX('Table'[Account Number Name CRM])&&
    'Table'[Month_Year]=MAX('Table'[Month_Year])&&
    'Table'[Date]=_date),[Value])

 

2. Result:

vyangliumsft_1-1713335679605.png

 

Best Regards,

Liu Yang

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

Thank you.

This is not why I'm locking for.

In your example, it schould be only Feb 2024 for A and C Only Jan.

Ony first value sorted by Month.

tamerj1
Super User
Super User

Hi @Dizzy 
Please elaborate on your expected result perhaps on top of the example that you've provided.

Dizzy
Frequent Visitor

Hi @tamerj1 

 

the value what I expected are in yellow in sorted by Fiscal Month.

The Last Row in my example is returned two values one in august and other one in january, I want to have at the end only august.

@Dizzy 
Not sure if you have seen my reply below. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.