Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello to all,
First of all here is my data table :
I would like to modify the "Filter" function of this measure :
Index_Arrets_Turbidity = RANKX(FILTER(ALL(fact_points_measures_faucon), fact_points_measures_faucon[id_measure_faucon]=370 && fact_points_measures_faucon[dt (1j)]>=DATE(2020,9, 1) && fact_points_measurements_faucon[dt (1d)]<=DATE(2020,12,1) ), CALCULATE(AVERAGE(fact_points_measurements_faucon[Index]),dim_measurements_faucon[group_measurement]="Turbidity"),,ASC,Skip)
I would like the values of DATE() not to be filled in manually but to be filled in automatically according to my time segment :
Thank you in advance
Joël
Solved! Go to Solution.
Hi @Anonymous
Index_Arrets_Turbidity =
VAR min_ =
MIN ( DateT[Date] )
VAR max_ =
MAX ( DateT[Date] )
RETURN
RANKX (
FILTER (
ALL ( fact_points_measures_faucon ),
fact_points_measures_faucon[id_measure_faucon] = 370
&& fact_points_measures_faucon[dt (1j)] >= min_
&& fact_points_measurements_faucon[dt (1d)] <= max_
),
CALCULATE (
AVERAGE ( fact_points_measurements_faucon[Index] ),
dim_measurements_faucon[group_measurement] = "Turbidity"
),
,
ASC,
SKIP
)
where DateT[Date] is the field you are using in the slicer
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
@Anonymous
You're not explaining what the expected result is and why, so I cannot check the result. In any case, it looks like youa renot following the pattern we developed earlier. You are seemingly ignoring the effects of context transition. Try:
Index_Arrets_Turbidity V2 =
VAR firstDate_ = [First date]
VAR lastDate_ = [Last date]
RETURN
RANKX (
FILTER (
ALL ( fact_points_mesures_faucon ),
fact_points_mesures_faucon[id_mesure_faucon] = 370
&& fact_points_mesures_faucon[dt (1j)] >= firstDate_
&& fact_points_mesures_faucon[dt (1j)] <= lastDate_
),
CALCULATE (
AVERAGE ( fact_points_mesures_faucon[Index] ),
dim_mesure_faucon[groupement_mesure] ="Turbidité"
),
,
ASC,
SKIP
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
@AlB What I would like to have is a Ranks function that automatically recalculates itself according to the time segment.
Roughly the same result as this function:
But without using "ALLSELECTED" because this function truncates the result of the other measurements that are related to it.
Thanks for your help
Joël
@Anonymous
I need more info.What exactly doesn't work?
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hello @AlB
The Ranks function continues to calculate on all dates without taking into account my min_ and max_ variables that I have integrated in my filter function. I shared my pbix so that it is more meaningful.
Hi @Anonymous
Index_Arrets_Turbidity =
VAR min_ =
MIN ( DateT[Date] )
VAR max_ =
MAX ( DateT[Date] )
RETURN
RANKX (
FILTER (
ALL ( fact_points_measures_faucon ),
fact_points_measures_faucon[id_measure_faucon] = 370
&& fact_points_measures_faucon[dt (1j)] >= min_
&& fact_points_measurements_faucon[dt (1d)] <= max_
),
CALCULATE (
AVERAGE ( fact_points_measurements_faucon[Index] ),
dim_measurements_faucon[group_measurement] = "Turbidity"
),
,
ASC,
SKIP
)
where DateT[Date] is the field you are using in the slicer
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hello @AlB
I'll contact you again regarding the same problem because the solution you kindly wrote to me doesn't work anymore. To make it easier, I am attaching the PBIX in the following link : https://1drv.ms/u/s!Ao1OrcTeY008gYU2OOM2oBSrDBzgpQ?e=1uVQAg
Thank you in advance for your help,
Joël
User | Count |
---|---|
54 | |
23 | |
19 | |
18 | |
17 |
User | Count |
---|---|
91 | |
87 | |
47 | |
30 | |
22 |