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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Juan_Lu
New Member

Table with first day of year and current day

Hi everyone,

 

I have a requirement from my client to compare in the same table data from  a date selected from slicer and the first day of the year. I can't get correct data.

 

Sample data:

date_loadID
01/01/2017ID1
01/01/2017ID2
01/01/2017ID3
01/01/2017ID4
01/06/2017ID1
01/06/2017ID2
01/06/2017ID3
01/09/2017ID1
01/09/2017ID2
31/12/2017ID1
01/01/2018ID1
01/01/2018ID7

and two measures:

Start Year = CALCULATE(COUNTROWS(Table1);FILTER(Table1;Year(SELECTEDVALUE(Table1[date_load])) = YEar(Table1[date_load])))

Current = COUNTROWS(Table1)

 

I need to show for 1/1/2017

Start Year = 4

Current =4

 

and for 31/12/2017

Start Year = 4

Current =1

 

but get 

Start Year = 1

Current =1

 

Thank you in advance

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Juan_Lu

 

Try this MEASURE

 

Start Year =
CALCULATE (
    COUNTROWS ( Table1 ),
    FILTER (
        ALL ( Table1 ),
        Table1[date_load] = DATE ( YEAR ( SELECTEDVALUE ( Table1[date_load] ) ), 1, 1 )
    )
)

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@Juan_Lu

 

Try this MEASURE

 

Start Year =
CALCULATE (
    COUNTROWS ( Table1 ),
    FILTER (
        ALL ( Table1 ),
        Table1[date_load] = DATE ( YEAR ( SELECTEDVALUE ( Table1[date_load] ) ), 1, 1 )
    )
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.