Skip to main content

Power BI

New

Field Parameters Measure

Vote (3) Share
Sriram Power BI Consultant's profile image

Sriram Power BI Consultant on 12 Dec 2022 13:21:33

Field Parameter Measure


Here is my idea 

Suppose I have a Field Parameter table called "Parameter" and column called "Parameter" which has two columns Product[Category] and Date[Calendar Year]


For example I want to create a rank measure 


I want to be able to create a generic measure like this 


RANKX(ALLSELECTED(Parameter[Parameter]),[Sales])


If Product[Category] or Date[Calendar Year] is selected from slicer or filter or by any other means then Parameter[Parameter] is replaced with Product[Category] or Date[Calendar Year] respectively .This measure gets passed to SUMMARIZECOLUMNS (Similar to how field parameters functionality works).


If multiple field parameters are filtered maybe either the measure returns blank or an Inscope function is generated programmatically so that measure values are correctly applied to fields 


Field parameter measure will enable creating a generic solution for field dependent measures thereby saving the overhead of maintenance of measures created due to repeating code