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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kane
Helper I
Helper I

Sample Query by Dates

Hi, PowerBI experts,

 

I would like to sample my query (such as SUM(Project[Progress])) by date and create a visual of "SUM(Project[Progress])  vs. the date" as below.

powerbi.PNG

 

i am wondering where to store the sampled values and how to generate the visual with DAX formula ?

 

 

THANKS !

Best Regards,

Kane

6 REPLIES 6
ImkeF
Super User
Super User

Have a look at the very good documentation here: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-measures/

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Thank you Imke !

 

Acctually, I have read most of the documentations of "PowerBI Desktop" and "PowerBI Service", and got a basic knowledge of the measures and formulas.

 

My question is that how to sample a query automatically by dates (not a Date collum in the query) and then creat a visual with the sampled values.

 

THANKS !

Kane

Sorry, but I don't understand what you mean with "sample by date": You need a column that for your axis.

How should the dates there be different from the "Date column in the query" that doesn't suit your needs? Could you please provide an example for it?

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hi, Imke,

 

Let's see a very simple case.

 

Suppose we have a project which was assigned to four persons (A,B,C,D). Each of them shares parts of the total tasks.

 

We use the following Excel table located in the Onedrive for Business to track the progress of the whole project.

All of the four persons are asked to update their progress into the Excel table everyday.

project.png

Therefore, we can easily transform the data to several simple PowerBI visuals, based on which we can read the latest progress of each person, as well as the total progress of the project.

 

However, we need not only "the latest progress", but also the trend of the progress. So, we need a PowerBI visual which will records the progress of yesterday, today and each of the following days. In other words, we want to create a visual whose Y-Axis is the "progress value" and the X-Axis is the "real Date".

 

We know that the Excel table will be updated by the four persons and contains only the up to date values.

So, my question is: how could I "record" (or "sample") the latest value every day so that I can transform them into a trend chart as below?

powerbi.PNG

 

THANKS !

 

 

Best Regards,

Kane

Oh I see - sorry, English is not my native language.

 

Here you go: http://www.thebiccountant.com/2016/02/09/how-to-create-a-load-history-or-load-log-in-power-query-or-...

 

Just take a simple date instead of datetime like in my article.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

thank you Imke ! I will try your solutions !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.