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
medaxing
Frequent Visitor

Calculate Measure with two Date Columns

Hi Folks,

I am looking to calcuate M1 where D1 = D2.  

Below is the example of the data.

medaxing_0-1647510382890.png

 

I have tried :

 

Option1:

VAR _Select = SELECTEDVALUE('CALENDAR'[DATE_FIELD])
Return
SUMX(FILTER('Table','Table'[DATE_FIELD_2] = _Select),'Table'[VALUE_FIELD])

 

Option2:

Final M1 = CALCULATE('VPT'[M1],
FILTER ('VPT', 'VPT'[D1] = 'VPT'[D2]))

 

Both didnt work.

Any help is really appreciated.

Thanks in advance.

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@medaxing , A measure like this should work

 

Final M1 = CALCULATE(sum('VPT'[M1]),FILTER ('VPT', 'VPT'[D1] = 'VPT'[D2]))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Hi

Thanks for the quick response.

As soon as I have SUM in the code then I cant find or select M1.

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.