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
kilala
Resolver I
Resolver I

Calculation based on different accounting date

Hi I have created 1 measure to calculate YTD amount for 3 division, (1,2,3). However, these 3 division might have different accounting date compared to our normal date. So, in my dimdate, i hvae 4 columns as sample below:

DatekeyDatePeriodKeyDiv1PeriodKeyDiv2PeriodKeyDiv3
202112282021/12/28202201202112202112
202112292021/12/29202201202112202201
202112302021/12/30202201202201202201
202112312021/12/31202201202201202201
202201012022/01/01202201202201202201

 

 

Logically, if I want to calculate YTD amount for any division, I should start adding amount starting from 20220101.

However, that is not the case here. 

In my case, if I want to calculate YTD amount for div1, i need to sum the amount starting from 20211228 until today.

if I want to calculate YTD amount for div2, i need to sum the amount starting from 20211230 until today.

if I want to calculate YTD amount for div3, i need to sum the amount starting from 20211229 until today.

 

How do I do that using measure?

Please help:)

 

Currently I am only connecting datekey from facttable to datekey from dimdate.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kilala,

I'd like to suggest you add segmentation table with these division and correspond date ranges.

Then you can map these divisions to your table records and write formula to calculate based on current division.(use current division to search on the segmentation table date range to filter in the formula calculations)

Dynamic segmentation – DAX Patterns

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @kilala,

I'd like to suggest you add segmentation table with these division and correspond date ranges.

Then you can map these divisions to your table records and write formula to calculate based on current division.(use current division to search on the segmentation table date range to filter in the formula calculations)

Dynamic segmentation – DAX Patterns

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.