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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
chrisrobaciu
Frequent Visitor

DateAdd problem with Quarter

Hello,

 

I have a weird problem which has been perplexing me for a couple of days:

 

I am trying to compare two (balance sheet) values over two periods based on the quarter end period that I select (using SWITCH):

 

1. Current period vs. prior year end (e.g. September vs. December)

2. Current period vs. prior quarter end (e.g. September vs. June).

 

All seems to work fine, EXCEPT FOR when I select the month of June to compare with the prior quarter end (which would be March) and the prior quarter appears to be blank. All other iterations work fine.

 

 The metric to compare is calculated as follows:

 

1. Actuals Measure: BS Actuals (base) = SUM('Summary Actuals'[Actual])

2. Selected Period Measure: BS Actuals = -CALCULATE([BS Actuals (base)],

FILTER(ALLSELECTED('Calendar'[Date]),'Calendar'[Date]<=SELECTEDVALUE('Calendar'[Month End])))

where "SELECTEDVALUE" is selected using a slicer.

3. Prior period comparative measure

BS Actuals (Comparative) = SWITCH('Scenario BS Comparison'[SelectedBSComp],
1, CALCULATE('BS Measures'[BS Actuals],DATEADD(ENDOFYEAR('Calendar'[Month End]),-1,YEAR)),
2, CALCULATE('BS Measures'[BS Actuals],DATEADD(ENDOFQUARTER('Calendar'[Month End]),-1,QUARTER)))

where the switch is used to flip between "vs. prior year" (works fine) and "vs. prior quarter" (works fine except for June vs. March).

 

The relevant relationships are below (month end -> month end)

chrisrobaciu_0-1631604440523.png

 

Supporting screenshots showing my issue:

 

1. Working fine (vs. prior year)

chrisrobaciu_1-1631604571715.png

2. Working fine (vs. prior quarter, sept vs. June)

chrisrobaciu_3-1631604627583.png

3. Not working 😞 : prior quarter, (June vs. March), displays blank in BS comparative.

chrisrobaciu_4-1631604659046.png

 

Many thanks in advance for your kind support (and thanks to all the other posts, I use this forum a lot!)

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@chrisrobaciu , Only use date

 

CALCULATE('BS Measures'[BS Actuals],DATEADD(ENDOFQUARTER('Calendar'[Date]),-1,QUARTER)))

 

or

 

CALCULATE([BS Actuals],DATEADD(('Calendar'[Date]),-1,QUARTER)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak , thank you for your quick reply and your help.

Unfortunately that didn't fix the issue that I have. When I change to date, it keeps the problem but introduces another problem (it removes the cumulative-to-date aspect of the comparative period).

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.