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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Dynamic calculation based on Date selection

Hello Team,

 

I have a separate date table which has a column like distinct(datasource[CutoffDate]). then I use this column to get calculation based on the month as shown below. **( cut off date coming from my data source)

 

ZF_PM-2 = VAR CurrentMonth = MAX(Datetable2[MyDate])
VAR PreviousDate = FORMAT(DATE(YEAR(CurrentMonth), MONTH(CurrentMonth) - 2, 1),"yyyy-MM")
VAr Result =
CALCULATE(
SUM(FACT_IA_IIIO_XQ227[ProvAmt]),
FILTER(FACT_IA_IIIO_XQ227,
 
FORMAT(FACT_IA_IIIO_XQ227[Audit End(CutOffDate)],"yyyy-MM") = PreviousDate
)
)
Return
Result
 
I have this calculation from Current month till previous month -10.  right now my current month is July. I then use my date column as a slicer to filter my desired date range.
 
So if we use the slicer to take feb'19, my Current month should change to feb'19  and respectively other months. but it does not happen, the current month stays July no matter what is the selection on the slicer.
3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

What is your slicer based on, Datetable2[MyDate]?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

yes, the slicer is based on the myDate  table.

Anonymous
Not applicable

HI @Anonymous ,

Current power bi not support to create dynamic column/table based on slicer/filter. Please modify your formula to write a measure to achieve your requirement.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.