Forum Discussion
Calculate min value based on user Selection
Hi All,
I have a sample data like below:
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
- Anonymous1 year ago
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:
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.
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.
6 Replies
- lbendlinSuper User
Example1: if user selects Product=P1 and Country=C1How 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?
- SQuaziFrequent Visitor
Yes, Product, Category, Country, Level and Skills are page level filters
- lbendlinSuper User
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-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523