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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous_001
Frequent Visitor

CALENDAR FUNCTION

hi Team,

Can measures be entered a input into the Calendar Function?

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

Thanks

9 REPLIES 9
parry2k
Super User
Super 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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k @Any further suggestions?

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.
parry2k
Super User
Super User

@Anonymous_001 weird, it should work, end date is greater than equal to the start date? Is it date or date/time?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@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
parry2k
Super User
Super User

@Anonymous_001 can you put those measures in a Card visual to see if they are returning a date value?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

yes tried that & returns the correct date values

parry2k
Super User
Super User

@Anonymous_001 yes by all means.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

wow....that fills me with hope.

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors