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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
rrr3521
Frequent Visitor

Calculations based on two date fields

Ok. Here's my problem. I have a table with two date fields (DateOrdered and DateInvoiced)

The DateInvoiced value typically a few weeks after the DateOrdered value (see sample below)

I'm trying to do some calculations based on both date fields. A simple example would be the SUM of sales (Price column) for last year. Using the example below, I would get $160 using DateOrdered and $40 using DateInvoiced

 

Ideally, we would like our user to pick that from a date slicer (as in the picture) and pick "Last 1 Year" for example. Then the result would be on a simple table with both sum of sales based on DateOrdered and also based on DateInvoiced (see picture)

 

Question.PNG

 

The immediate problem is that the slicer can only be linked to one of the dates on my table. 

 

I have only been able to use a LIMITED number of options (YTD, MTD, etc) using the approach described in this video: https://www.youtube.com/watch?v=I0UV7bGvu_U

 

Notice in the video how the timeframes are defined in a table called SelectMeasures. So we would need to add in that table a limited number of options (YTD, MTD, QTD, etc). Whereas by a having a single date slicer we can pick pretty much any possible timeframe (i.e. last 7 weeks, last 3 days, last 8 months, this month, next day, etc, etc, etc)

 

Any possible way this can be accomplished? I already told my manager this might not be possible, but maybe there is a clever way to do it. Any help would be truly appreciated.

 

Thanks!

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Check out my Quick Measures here which might help you with your situation:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



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...

Thank you Greg! I will go ahead and see how I can use what it is demonstrated in the articles.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors