Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
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.
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
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.
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
https://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.
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |