The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone,
I would like to calculate the downtime of my production machine. Here is my data table :
I will try to explain my problem. First of all, I am French, which explains the writing of certain measures. I analyze the production of a hydroelectric power plant according to a turbidity threshold. Turbidity is the power of water. The higher its value is, the greater the risk of deteriorating our equipment. The definition of this threshold is important because it is the one that will determine whether or not we shut down the hydroelectric plant. My first objective was to find the turbidity value for a day of shutdown of the power station according to a period of time that I will have chosen thanks to the segment. To create this measurement I first used the "index" column of my Dataset and created the following measurement:
Index_Arrets_Turbidité = RANKX(FILTER(ALLSELECTED(fact_points_mesures_faucon[dt (10 min)],fact_points_mesures_faucon[id_mesure_faucon]), fact_points_mesures_faucon[id_mesure_faucon]=370),
[Index turbidité],,ASC,Skip)
370 being the ID of the turbidity measuring probe. Then I created the measurement allowing me to identify the turbidity value corresponding to a day of shutdown of the power plant:
Val_Turb_Arrets_1j = MAXX(FILTER(ALLSELECTED(fact_points_mesures_faucon[dt (10 min)],fact_points_mesures_faucon[id_mesure_faucon]), fact_points_mesures_faucon[id_mesure_faucon]=370 && [Index_Arrets_Turbidité] = 144), [Turbidité])
I used 144 because my time base is in DT10MIN and therefore 24*6 is equal to 24h. The result obtained corresponds to my expectations. I then created a measure to calculate the downtime in h by first creating an "IF" function:
Arrêts turbidité_1j =
IF([Turbidité]>=[Val_Turb_Arrets_1j],1,0)
Then a measurement that summarizes the downtime :
Arrêts turbidité_temps_1j (en h) =
SUMX(SUMMARIZE(VALUES(fact_points_mesures_faucon[dt (10 min)]),fact_points_mesures_faucon[dt (10 min)],"STOP",[Arrêts turbidité_1j]/6),[STOP])
Problem, here are the results I get:
However, when in the measurement "Tubidity stops_1j" I manually enter the turbidity threshold like this:
Arrêts turbidité_1j =
IF([Turbidité]>=78,1,0)
The result obtained is the following and it corresponds to my expectations:
I would therefore like this result without having to manually enter the turbidity threshold since I have it automatically with the "Val_Turb_Arrets_1j" measurement. I attach two CSV files to better understand the dataset I have. "Analyse Turbidité_Manuel" corresponds to the data I get by typing the turbidity threshold manually. "Analyse Turbidité Automatique" corresponds to the data I get with the measurement IF([Turbidité]>=[Val_Turb_Arrets_1j],1,0)".
https://1drv.ms/u/s!Ao1OrcTeY008gYU002hcwyM1NXYNsw?e=JFB2q8
https://1drv.ms/u/s!Ao1OrcTeY008gYUzObVYKCPcAd_81w?e=5cKcbF
Thank you in advance for your help.
Joël
Measures are used when the result can be impacted by users interacting with the visuals (using filters etc). Calculated columns are used if the computation result is immutable, ie it is independent of the user's actions.
Ok but in my case the measurement of the turbidity threshold is well impacted by the action of a user since the turbidity threshold varies according to the period that is analyzed. Example: if the analysis segment starts on 01/08/2020 and ends on 31/08/2020 the threshold will be 80 for example. But if the analysis segment starts from 01/08/2020 and ends on 31/11/2020 it will be 75 for example still. So the action of the user on the analysis period has an impact on the result of my measurement. What do you think about it?
What is your reasoning for using measures here? As I understand it the turbidity is not impacted by filter values, so a calculated column would be more appropriate.
Hello @lbendlin
I didn't quite understand what you mean by the fact that turbidity is not impacted by filter values. And also what do you suggest to do with a calculated column?
Thank you in advance,
Joël
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |