cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Find first year value

Hi All,

I would like to find the value in the earliest Year. For example, if I filter to [Year ] = 2020, I should see the following. My Year slicer is single selection.

• BA1 = 21
• BA2 = 32
• BA3 = 13

Does anyone know how can I do that using a measure? Thanks.

Regards,

BK

5 REPLIES 5
Community Support

Hi @Anonymous ,

What kind of card visual you are looking for? Each code has a card visual or put them in one card visual?

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Community Champion

Try:

min year value =
VAR MinYear = MINX(ALLEXCEPT(Table, Table[Code]), Table [Year])

RETURN

CALCULATE(SUM(Table[Value]), FILTER(ALL(Table), Table[Year] = MinYear))

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Resident Rockstar

@Anonymous, Try the below code in measure

CALCULATE(SUM(Table[Value]), Table[Year] < 2020)

Super User

@Anonymous , Try a measure like for value

Measure =
VAR __id = MAX ('Table'[Code] )
VAR __date = CALCULATE ( Min('Table'[Year] ), ALLSELECTED ('Table' ), 'Table'[Code] = __id )
CALCULATE ( Sum ('Table'[Value] ), VALUES ('Table'[Code] ),'Table'[Code] = __id,'Table'[Year] = __date )

if needed take min for year in visual

Anonymous
Not applicable

Hi @amitchandak , thanks for your help. The dax works well in a table visual but it doesn't show the correct earliest value when it is used in a Card visual

Regards,

BK

Announcements

#### 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.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors