The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello Experts!
I have a measure which sums values based on selected value of slicers, namely Year and Period. My question is about dynamically changing values in the FILTER part.
That depends on the selected period in the clicer.
FCST012 Forecast =
VAR Ayear =
SELECTEDVALUE ( Dim_YearPeriod[Year] )
VAR Aperiode =
SELECTEDVALUE ( Dim_YearPeriod[PERIOD] )
VAR Aperiode2 =
IF(SELECTEDVALUE ( Dim_YearPeriod[Period] ) <= 9, "0" & Aperiode, Aperiode)
RETURN
CALCULATE (
SUM ( fact_Consolidated[VALUECOLUMN] ),
fact_Consolidated[SCENARIO]
= Ayear & Aperiode2 & "FCT_CON",
FILTER (
ALL ( Dim_YearPeriod ),
Dim_YearPeriod[Year] = Ayear
&& Dim_YearPeriod[PERIOD] = ??????
)
)
On top there are two slicers for year and period. The question marks is the part I can’t figure out.
It should be the remaining periods. If slicers are as follows: 2022 and period 6 it should be period 7 && 8 && 9 && 10 && 11 && 12.
If selected period is 7 it should be period 8 && 9 && 10 && 11 && 12 etc.
Any help on how i can dynamically pass those values in the FILTER part of the measure is much appreciated.
Solved! Go to Solution.
I understand you want to figuer Remaining period with larger than selected period, try this
RETURN
CALCULATE (
SUM ( fact_Consolidated[VALUECOLUMN] ),
fact_Consolidated[SCENARIO]
= Ayear & Aperiode2 & "FCT_CON",
FILTER (
ALL ( Dim_YearPeriod ),
Dim_YearPeriod[Year] = Ayear
&& Dim_YearPeriod[PERIOD] > Aperiod
)
)
I understand you want to figuer Remaining period with larger than selected period, try this
RETURN
CALCULATE (
SUM ( fact_Consolidated[VALUECOLUMN] ),
fact_Consolidated[SCENARIO]
= Ayear & Aperiode2 & "FCT_CON",
FILTER (
ALL ( Dim_YearPeriod ),
Dim_YearPeriod[Year] = Ayear
&& Dim_YearPeriod[PERIOD] > Aperiod
)
)
Thanks Hoang Hugo, this totally did the job!
User | Count |
---|---|
69 | |
67 | |
62 | |
48 | |
28 |
User | Count |
---|---|
113 | |
77 | |
65 | |
55 | |
43 |