Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AlyssaBA
Regular Visitor

Passing a chosen column from dynamic field parameter to a measure.

I have an issue and I would like to ask for your assistance.  I searched a lot but could not find a solution.  My issue is as below.

 

- I created a dynamic field parameter that allowed me to choose a column (from a list of columns) to be used in a report.

- Then, I wanted to pass that chosen column to a measure.  However, it did not work as the column chosen from the dynamic field parameter did not work in the measure.

 

This is the dynamic field parameter I created:

AlyssaBA_0-1720815922161.png


Now, I wanted to create a measure that would pick the lowest category in the chosen field as the base category (_base_cat); calculate the first-year retention rate of that base category (_min_pct); and then calculate the first-year retention ratedifference for each remaining category based off of the _min_pct.  See my calculated measure below.

AlyssaBA_1-1720816549072.png

However, it did not work, as you can see below.  To check it, I returned _base_cat, but the "White" category did not show up.  Instead, the text name of the chosen column displayed.  That means the chosen column did not kick in.

AlyssaBA_2-1720817015438.png


Any suggestions/solutions are much appreciated!



 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1720849800297.png

 

 

expected result: = 
VAR _allsales =
    CALCULATE ( [sales:], REMOVEFILTERS () )
VAR _percentage =
    DIVIDE ( [sales:], _allsales )
VAR _basesales =
    MINX (
        SUMMARIZE (
            FILTER (
                sales_support_calculation,
                sales_support_calculation[category] = MAX ( prm_category[prm_category] )
            ),
            sales_support_calculation[items]
        ),
        CALCULATE ( SUM ( sales_support_calculation[sales] ) )
    )
VAR _basesalespercentage =
    DIVIDE ( _basesales, _allsales )
RETURN
    _percentage - _basesalespercentage

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1720849800297.png

 

 

expected result: = 
VAR _allsales =
    CALCULATE ( [sales:], REMOVEFILTERS () )
VAR _percentage =
    DIVIDE ( [sales:], _allsales )
VAR _basesales =
    MINX (
        SUMMARIZE (
            FILTER (
                sales_support_calculation,
                sales_support_calculation[category] = MAX ( prm_category[prm_category] )
            ),
            sales_support_calculation[items]
        ),
        CALCULATE ( SUM ( sales_support_calculation[sales] ) )
    )
VAR _basesalespercentage =
    DIVIDE ( _basesales, _allsales )
RETURN
    _percentage - _basesalespercentage

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.