Forum Discussion
CALENDAR FUNCTION
hi Team,
Can measures be entered a input into the Calendar Function?
e.g. Calendar(<measure1>, <measure2>)
Thanks
9 Replies
- parry2kSuper User
Anonymous_001 weird, it should work, end date is greater than equal to the start date? Is it date or date/time?
- Anonymous_001Frequent 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/yyMAJOR is a calculated measure returning latest date from data. Testing it on Card Visual returns 22/07/24. Measure has format dd/mm/yy
- parry2kSuper User
Anonymous_001 yes by all means.
- Anonymous_001Frequent Visitor
wow....that fills me with hope.
I've tried to use measure in Calendar function but returns blank calendar table
- parry2kSuper User
Anonymous_001 can you put those measures in a Card visual to see if they are returning a date value?
- Anonymous_001Frequent Visitor
yes tried that & returns the correct date values
- parry2kSuper 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_001Frequent 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 slicerMAJOR = VAR SelectedSource1 = SELECTEDVALUE('TableA'[Source])VAR FilteredTable1 = FILTER('TableA', 'TableA'[Source] = SelectedSource1)VAR LatestDate = MAXX(FilteredTable1, 'TableA'[Calendar Week])RETURNLatestDateMINOR =VAR SelectedSource = SELECTEDVALUE('TableA'[Source])VAR FilteredTable = FILTER('TableA', 'TableA'[Source] = SelectedSource)VAR OldestDate = MINX(FilteredTable, 'TableA'[Calendar Week])RETURNOldestDate
[Calendar Week] is Date Data Type with format dd/mm/yyTesting MINOR on Card Visual returns 21/08/23. Measure has format dd/mm/yyTesting MAJOR on Card Visual returns 22/07/24. Measure has format dd/mm/yyI'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. - Anonymous_001Frequent Visitor
parry2k @Any further suggestions?