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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Thilini
Frequent Visitor

Incorrect total - Dax calculation with date MIN/MAX

Hi Experts,

I am new to power BI. I want to get total targets for the period between minimun service date and maximum service date.

Total Current Target for below period should be : 73388. But when I applied the dax fomular it shows : 69936

  • minimun service date = 2018/01/01
  • maximum service date = 2019/12/31

Dax calculation applied,

CurrentTargetCALCULATE(sum(mh_target[occasion_of_service]),filter(mh_target,mh_target[Target_startdate]<=service_contact[Max serviceYearMonth]&& mh_target[Target_startdate]>=service_contact[Min serviceYearMonth]))

 

Could you kindly giude me If there is any issue with the calculation please.

 

Thank you!

Thilini

Query 1.PNG

2 REPLIES 2
Anonymous
Not applicable

@Thilini Your measure looks correct to me but I feel like you have first date of each month in Target_startdate column and when  comparing mh_target[Target_startdate]<=service_contact[Max serviceYearMonth] you are missing December month data for year 2019. What is the column that you are using in adjacent to occasion of service is that target start date column or any other column?

Hi Vimal,

Thank you for your reply.

 

Yes I am using Target_startdate adjacent to occasion of service. I put first date of each month as target table doesn't have a date column. It has two seperate columns for month and year.

Exactly my concerns is also why it is missing December month data for year 2019? Because it filters for 2018/01/01(min) and 2019/12/01(max).

 

Really appreciate your support. Thank you!

 

Kind Regards,

Thilini

 

Kind Regards,

Thilini

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.