Forum Discussion

Anonymous_001's avatar
Anonymous_001
Frequent Visitor
3 years ago

CALENDAR FUNCTION

hi Team,

Can measures be entered a input into the Calendar Function?

e.g. Calendar(<measure1>, <measure2>)

Thanks

9 Replies

    • Anonymous_001's avatar
      Anonymous_001
      Frequent Visitor

      parry2k, the end date is greater than start date. This is the formula which returns blank values

      CALENDAR([MINOR], [MAJOR])
      MINOR is a calculated measure returning oldest date from data. Testing it on Card Visual returns 21/08/23. Measure has format dd/mm/yy
      MAJOR is a calculated measure returning latest date from data. Testing it on Card Visual returns 22/07/24. Measure has format dd/mm/yy
    • Anonymous_001's avatar
      Anonymous_001
      Frequent Visitor

      wow....that fills me with hope.

      I've tried to use measure in Calendar function but returns blank calendar table

  • Anonymous_001 not sure what I'm missing here, can you share the pbix file using one drive/google drive, remove sensitive information before sharing

    • Anonymous_001's avatar
      Anonymous_001
      Frequent Visitor

      Unfortunately, I'm unable to share file due to work IT restrictions.
      Basically, there is one table with data extracted on different dates. I've called this the source column (Text Data type because the values are alpha numeric)
      Below is the formula to calculate the 2 measures in the table which returns the old and recent date based on the user selection of source column slicer 

      MAJOR = VAR SelectedSource1 = SELECTEDVALUE('TableA'[Source])
      VAR FilteredTable1 = FILTER('TableA', 'TableA'[Source] = SelectedSource1)
      VAR LatestDate = MAXX(FilteredTable1, 'TableA'[Calendar Week])
      RETURN
      LatestDate
      MINOR =
      VAR SelectedSource = SELECTEDVALUE('TableA'[Source])
      VAR FilteredTable = FILTER('TableA', 'TableA'[Source] = SelectedSource)
      VAR OldestDate = MINX(FilteredTable, 'TableA'[Calendar Week])
      RETURN
      OldestDate
      [Calendar Week] is Date Data Type with format dd/mm/yy
      Testing MINOR on Card Visual returns 21/08/23. Measure has format dd/mm/yy
      Testing MAJOR on Card Visual returns 22/07/24. Measure has format dd/mm/yy
      I'm trying to create Calendar table using MINOR and MAJOR as the 2 date inputs. The formula doesnt give any errors but returns a blank table.