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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.