Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |