Forum Discussion
Anonymous_001
3 years agoFrequent Visitor
CALENDAR FUNCTION
hi Team, Can measures be entered a input into the Calendar Function? e.g. Calendar(<measure1>, <measure2>) Thanks
parry2k
3 years agoSuper User
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
3 years agoFrequent 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
[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.