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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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