Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |