Showing results for 
Search instead for 
Did you mean: 
shilpikumari_11 Regular Visitor
Regular Visitor

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 =
FORMAT(FACT_IA_IIIO_XQ227[Audit End(CutOffDate)],"yyyy-MM") = PreviousDate
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.
Super User
Super User

Re: Dynamic calculation based on Date selection

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

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

shilpikumari_11 Regular Visitor
Regular Visitor

Re: Dynamic calculation based on Date selection

yes, the slicer is based on the myDate  table.

Community Support Team
Community Support Team

Re: Dynamic calculation based on Date selection

HI @shilpikumari_11 ,

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.


Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For learning resources/Release notes, please visit: | |

Helpful resources


How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 157 members 2,011 guests
Please welcome our newest community members: