Forum Discussion

jhdavis's avatar
jhdavis
Regular Visitor
9 years ago
Solved

Measure based on Parameter

I'm trying to use the parameter function in PBI desktop to find cost index: countries' unit costs divided by a baseline country's unit costs. The baseline country is the parameter country that I woul...
  • jhdavis's avatar
    9 years ago

    I figured it out, so I'll post what I did on here in case someone comes across this in the future.

     

    I created a separate blank query then "entered data" by pasting a column of all unique country names. Then measure DAX:

    Client Cost Index = CALCULATE(DIVIDE([Unit Cost],CALCULATE([Unit Cost],Vendors[VendorCountry]=VALUES(Parameter[ParameterCountry]))),FACTS[FactSource]="Client")

    Then just throw another slicer on the dashboard and drop the [parametercountry] in it. It'll show an error on any visual unless only one selection on that slicer is selected.