Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Dear All,
I need your help for geting the result column as below:
I want to have a power query and a dax code to get the result column based on Criteria Column.
if the criteria column contain "cash" then the result column return cash for the same TranCode Column and the rest
that don't meet the Criteria Column return null.
Please noted that for large data set I can merge column to get the result in power query but the pefromance is too slow and i want a better way for power query code that avoid merging column.
| TranCode | Acc Decription | Criteria | Result |
| A1 | Exp | null | Cash |
| A1 | Cash | Cash | Cash |
| B1 | Exp | null | null |
| B1 | Payable | null | null |
| C1 | Exp | null | null |
| C1 | Payable | null | null |
| D1 | Exp | Cash | Cash |
| D1 | Cash | null | Cash |
Appriciate for you kind help.
Best regards,
Heng
Solved! Go to Solution.
Hi,
This calculated column formula works
=if(CALCULATE(CALCULATE(COUNTROWS(Data),Data[Criteria]="Cash"),FILTER(Data,Data[TranCode]=EARLIER(Data[TranCode])))=1,"Cash",BLANK())
Hi,
This calculated column formula works
=if(CALCULATE(CALCULATE(COUNTROWS(Data),Data[Criteria]="Cash"),FILTER(Data,Data[TranCode]=EARLIER(Data[TranCode])))=1,"Cash",BLANK())
Dear Ashish_Mathur,
Very nice formula.
Do you have any solution in power query?
Thanks for your help.
Best regards,
Heng
Hi,
Thank you. No i do not know how to solve this in the Query Editor.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 48 | |
| 36 | |
| 31 | |
| 29 |