Forum Discussion
Anonymous
5 years agoNot applicable
Create a filter with a measure.
Hello all! Is there a way to create a filter in the form of a measure? I want to write like this: Measure =
CALCULATE(
expression,
[Filter Measure]
) Is there a similar way to do ...
Anonymous
5 years agoNot applicable
Kumail Wouldn't mind giving you a kudo if you helped me with the measure! 😊
How do I sent a pbix-sample? Sorry, I am new to this.
Productivity with Variables =
VAR SelectedYTD =
FILTER(
ALL('Calendar'[Quarter],'Calendar'[Year]),
AND(
'Calendar'[Year] = SELECTEDVALUE( 'Calendar'[Year] ),
'Calendar'[Quarter] = SELECTEDVALUE( 'Calendar'[Quarter] )
)
)
VAR YearBefore =
FILTER(
ALL( 'Calendar'[Year] ),
'Calendar'[Year] = SELECTEDVALUE( 'Calendar'[Year] ) - 1
)
VAR MHworked =
[Man-hours worked - Staff registered Actual SUM]
+ [Man-hours worked - Workers registered Actual SUM]
+ [Manhours worked agency people SUM]
VAR VAatSC = [Value added at SC SUM]
RETURN
DIVIDE(
DIVIDE(
CALCULATE(
VAatSC,
KEEPFILTERS( SelectedYTD )
),
CALCULATE(
MHworked,
KEEPFILTERS( SelectedYTD )
),
0
),
DIVIDE(
CALCULATE(
VAatSC,
KEEPFILTERS( YearBefore )
),
CALCULATE(
MHworked,
KEEPFILTERS( YearBefore )
),
0
)
)
*100I've made this measure. However, it always return 100. It is probably something about the row-context that I don't understand. And I want to recreate the filters with measures instead so that I don't have to have the first 20 rows in each measure I do.
Thank you very much for your help. I really appreciate it.