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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How can I display earliest and latest date of available data?

I am pulling in sales data in Power BI Desktop. Besides some other identifiers, the data includes one of three possible vendors (e.g. 'Vendor A', 'Vendor B', 'Vendor C') and the respective date (on a daily basis) the data is from. I now want to display this information on one of my sheets, e.g. I somehow want to show the earliest date and the latest date of available data for each vendor, allowing my users to know in which range they can work.

I found another thread on this forum with a similar request, but everything mentioned there exceeds my current knowledge of Power BI, so I am not able to verify whether this would work for my needs. If the solution in this other thread is the one I should be using, could anyone help me out with a few additional steps to get this running? If I need to do something else, could you point me in the right direction?

Thank you very much for your help!

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a couple of measures as

Earliest Date = CALCULATE( MIN('Table'[Date]) )
Latest Date = CALCULATE( MAX('Table'[Date]))

If you include those in a visual with the Vendor column then it should work I think

View solution in original post

6 REPLIES 6
johnt75
Super User
Super User

You could create a couple of measures as

Earliest Date = CALCULATE( MIN('Table'[Date]) )
Latest Date = CALCULATE( MAX('Table'[Date]))

If you include those in a visual with the Vendor column then it should work I think

Anonymous
Not applicable

Oh wow, thank you so much, @johnt75. I just created a new table in Power BI with the Vendor column and the measures and it works perfectly. 

This might be a trivial question, but at the moment, the dates are formated in a way that includes the time as well (which is always 00:00:00, as it is not specified in the source). Is there a way to get rid of this via formatting in Power BI, or is that something that needs to be changed in the source?

you can change the column type from datetime to date, you can also change the format to be long dat, short date etc.

Anonymous
Not applicable

I think the option I am looking for is the change of the column type. Could you point me to the place where I can find this?

You can either do it in Power Query by clicking on the little calendar icon with a clock on it, in the column header, or you can do it in Power BI desktop. Select the column, choose column tools from the top menu and data type is in there.

Power Query is probably the best place to do it.

Anonymous
Not applicable

Thank you again, that was definitely helpful. I also found that it is possible to change the format the measure calculates, I think in my case, the error was there.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.