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

Measuring the history of a table


Hello everyone,

I am asking for your help in creating a measure. My report analyzes the production of different power generation sites. I have in my report several tables analyzing different periods thanks to the filter section (for example here, the filter asks to analyze the previous month, i.e. the month of January).

image.png


The different column values used in my tables refer to comparisons with results from previous years. I would like to add a column that tells me for each power plant, the number of days of history I have (the first value entered and this for each power plant because almost no power plant has the same data history).

 

I join my PBIX for a better understanding,

https://1drv.ms/u/s!Ao1OrcTeY008gYVOjhpqo1EzMlXjdQ?e=mB6y9S 

Thank you in advance,

 

Have a nice day

 

Joël

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello to all,

I found a solution to my own problem:
I created a measurement that corresponds to the ID of each of my power plants (a different ID for each power plant):
id_site = CALCULATE(SUM(dim_site [id]))
Then I created this measure with the "FILTER" function to find the date of the first data of each plant:
First_data = MINX(FILTER(ALL(fact_points_mesures_faucon),RELATED(dim_site[id])=id_site),fact_points_mesures_faucon[dt].[Date])

 

Thank you to @mahoneypat and @lbendlin  for trying to help me anyway,

 

Good day to all,

 

Joël

View solution in original post

5 REPLIES 5
mahoneypat
Employee
Employee

Is this what you mean?  This gives the # of days between your First Date measure and TODAY()

 

Days of Data = DATEDIFF([First_Date], TODAY(), DAY)
 
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hello @mahoneypat,

First of all (again) thank you for your help.
Indeed it works on the page of my report named "Relative period evolution" but I would also like to be able to do the same thing on the other pages ("Daily evolution", "Evolution month N", "Evolution month N-1") but it doesn't work:

image.png
Thank you in advance for your help,

Joël

lbendlin
Super User
Super User

You mean like this?

 

lbendlin_0-1613872043312.png

 

Anonymous
Not applicable

Hello @lbendlin ,

First of all thank you for reacting to my post.
Here is an example with 4 power plants:

image.png
we can see in the column "Deouis le" the date of the first recorded data. You have to start from this date to the current date to get the number of days in the history.

I have just realized that I have published a bad version of my pbix, here is the updated version with the complete data of 4 stations

https://1drv.ms/u/s!Ao1OrcTeY008gYVOjhpqo1EzMlXjdQ?e=nrGlgb

 

Thank you in advance,

 

Joël

 

Anonymous
Not applicable

Hello to all,

I found a solution to my own problem:
I created a measurement that corresponds to the ID of each of my power plants (a different ID for each power plant):
id_site = CALCULATE(SUM(dim_site [id]))
Then I created this measure with the "FILTER" function to find the date of the first data of each plant:
First_data = MINX(FILTER(ALL(fact_points_mesures_faucon),RELATED(dim_site[id])=id_site),fact_points_mesures_faucon[dt].[Date])

 

Thank you to @mahoneypat and @lbendlin  for trying to help me anyway,

 

Good day to all,

 

Joël

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.

Top Solution Authors