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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
chalapathy
Frequent Visitor

Get data from production table with dates between first day and last day set by measure

We have our production days from 7:00 AM to 6:59:59 AM the next day and production week starts at Saturday 7:00 AM and goes upto 6:59:59 AM next Saturday. I have set a custom date table  that have date at 7:00 AM and corresponding week number.

I can set measures to First Date and Last date based on week selected. I need to pass these measures to production table and get data between these tables in a tabular list of all items produced during this time period based on user selected Week number. 

How can I set these date measures to filter tble data?

2 REPLIES 2
Stachu
Community Champion
Community Champion

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1Column2
A1
B2.5

 

if your production table has dates in the same format as in the date table then you just need a join between the tables on the date column

When you filter for a week it will automatically pass the first&last dates.

If your production table can have different values (e.g. different time) then I can help when you share the tables



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

sturlaws
Resident Rockstar
Resident Rockstar

Hi,

 

So your date table consists of one row pr day, right?

 

How does your data table look like? And what kind of date and time fields does the data table have?

 

If you data table contains something that needs to be summed or counted, you could do something like this:

Measure =
CALCULATE (
    SUM ( Table[Something] );
    FILTER (
        Table;
        Table[DateTime] >= MIN ( dimDate[DateTime] )
            && Table[DateTime] <= MAX ( dimDate[DateTime] )
    )
)

 

But it would probably be a better solution to create a link between you table and data dimension. This you can do by creating a separate date column in you data table, where rows where hours are between 00:00 and 07:00 is given the date of the previous day.

It would be easier to answer you questions if you add sample data or .pbix-file, there is a section about this in the guidelines:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.