Forum Discussion
Formula Conversion
- 7 years ago
Hi Daniel,
Your logic will definitely work in the case "A" is minimum, which is actually Minimum in the example but actually my Data set is something like this
Suppose the dataset Looks like This:
ID Item 1 Soap 1 Pen 1 Pencil 2 Soap 2 Rubber 2 Paper
In Tableau, I would Simply write this{FIXED ID:MAX(IF Item="Soap" Then Item end)}
to get This:
ID Item Result 1 Soap Soap 1 Pen Soap 1 Pencil Soap 2 Soap Soap 2 Rubber Soap 2 Paper Soap I am looking for Similar Logic in Power BI.
Thanks a lot
Deepak
- 7 years ago
Hi drrai66,
Based on my test, you could try this formula:
Measure = CALCULATE(MAX(Table1[Item]),FILTER(ALL('Table1'),'Table1'[Item]="M"))Result:
Regards,
Daniel He
Hi drrai66,
Based on my test, you could refer to below formula:
Measure = CALCULATE(MIN('Table1'[Item]),FILTER(ALLSELECTED('Table1'),'Table1'[ID]=1))Result:
Regards,
Daniel He
Hi Daniel,
Your logic will definitely work in the case "A" is minimum, which is actually Minimum in the example but actually my Data set is something like this
Suppose the dataset Looks like This:
| ID | Item |
| 1 | Soap |
| 1 | Pen |
| 1 | Pencil |
| 2 | Soap |
| 2 | Rubber |
| 2 | Paper |
In Tableau, I would Simply write this
{FIXED ID:MAX(IF Item="Soap" Then Item end)}
to get This:
| ID | Item | Result |
| 1 | Soap | Soap |
| 1 | Pen | Soap |
| 1 | Pencil | Soap |
| 2 | Soap | Soap |
| 2 | Rubber | Soap |
| 2 | Paper | Soap |
I am looking for Similar Logic in Power BI.
Thanks a lot
Deepak
- v-danhe-msft7 years agoMicrosoft Employee
Hi drrai66,
Based on my test, you could try this formula:
Measure = CALCULATE(MAX(Table1[Item]),FILTER(ALL('Table1'),'Table1'[Item]="M"))Result:
Regards,
Daniel He
- drrai667 years agoResolver I
Yes That's It!!! Thanks a Lot