Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Days in Year

Hi Experts

 

Is it possible to dynamically work out the number of days in the year - via a measure with out using a slicer and or filter. i have a Full Dimdate table in my model. so for this year 365 (2021) and so on until 2024 which is 366..using the dimdate table.

 

I want to show the days in a single card visual.

  • create two calucated column in dim table

    Year = YEAR('Date'[Date].[Date])

    No of days in year= if(DIVIDE('Date'[Year],4)=0,"366","365")

3 Replies

  • create two calucated column in dim table

    Year = YEAR('Date'[Date].[Date])

    No of days in year= if(DIVIDE('Date'[Year],4)=0,"366","365")

    • Anonymous's avatar
      Anonymous
      Not applicable

      Many thanks...

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi worked out NumberOfDays in Current Year = IF(MOD(YEAR(MAX('Table'[Date])),4)=0,366,365)