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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SQuazi
Frequent Visitor

Calculate min value based on user Selection

Hi All,

 

I have a sample data like below:

SQuazi_0-1733918357624.png

where i want to calculate min of (D_Factor) .

For Example1: if user selects Product=P1 and Country=C1 then Result=min( D_Product and D_Country)=0.5

Example 2: if user selects Product=P1 then Result=min(D_Product)=1

 

Kindly suggest DAX to achieve the above results based on dynamic user selections.

would appreciate your help

 

Regards,

Sabahat

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @SQuazi 

Regarding the issue you raised, my solution is as follows:

1.Firstly, I have created your sample data based on your description as follows:

vlinyulumsft_0-1734071433608.png

2. Below are the measure I've created for your needs:

Min_D_Factor_All = 
MINX(
    {
        IF(ISFILTERED('Table'[Product]), MIN('Table'[D Product]), BLANK()),
        IF(ISFILTERED('Table'[Category]), MIN('Table'[D Category]), BLANK()),
        IF(ISFILTERED('Table'[Country]), MIN('Table'[D Country]), BLANK()),
        IF(ISFILTERED('Table'[Level]), MIN('Table'[D Level]), BLANK()),
        IF(ISFILTERED('Table'[Skill]), MIN('Table'[D Skill]), BLANK())
    },
    [Value]
)

3.Here's my final result, which I hope meets your requirements.

 

vlinyulumsft_1-1734071485041.png

 

 

vlinyulumsft_2-1734071485042.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

Example1: if user selects Product=P1 and Country=C1 

 How is the user selecting these items?   Do you have filters for these columns?

 

Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?

 

 

Yes, Product, Category, Country, Level and Skills are page level filters

Anonymous
Not applicable

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @SQuazi 

Regarding the issue you raised, my solution is as follows:

1.Firstly, I have created your sample data based on your description as follows:

vlinyulumsft_0-1734071433608.png

2. Below are the measure I've created for your needs:

Min_D_Factor_All = 
MINX(
    {
        IF(ISFILTERED('Table'[Product]), MIN('Table'[D Product]), BLANK()),
        IF(ISFILTERED('Table'[Category]), MIN('Table'[D Category]), BLANK()),
        IF(ISFILTERED('Table'[Country]), MIN('Table'[D Country]), BLANK()),
        IF(ISFILTERED('Table'[Level]), MIN('Table'[D Level]), BLANK()),
        IF(ISFILTERED('Table'[Skill]), MIN('Table'[D Skill]), BLANK())
    },
    [Value]
)

3.Here's my final result, which I hope meets your requirements.

 

vlinyulumsft_1-1734071485041.png

 

 

vlinyulumsft_2-1734071485042.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

I am attaching sample PBIX file here. 

I wanted to make line 7 work in highlighted measure

SQuazi_0-1734069839525.pnghttps://drive.google.com/file/d/1PzsjJLn_SBSIGMJeWDBswpJZAibCkF68/view?usp=drive_link 

 

Note that SELECTEDVALUE already gives you the option to specify an alternative value when nothing or more than one item is selected.

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.