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.
I have a data set that includes the folloiwng information,
Income Date, Amount, Source Code, Payment menthod.
What i am looking for is a way to add some caluclated data based on the Source Code and Payment Method. This would normally be done via an sql statment in the Legacy CRM but we are migrating into CRM365 and as such cannot be added as a calculated field (so i am told). Is it possible to add via PowerBI once i refresh the income data
The Script in a simpliefed version is below but where we have "Sourcecode like 'ADSO%" i think this should be 'Source Code begins with ADSO' in PowerBi
If the below is true the add REG into the line
((Payment Method = 'Standing Order' or Payment Method = 'Direct Debit' or Payment Method = 'Standing Order' or Payment Method = 'Give As You Earn' or Payment Method = 'Paperless Direct Debit')
or
((Payment Method = 'CAF Voucher' or Payment Method = 'Credit Card')
and
(Sourcecode like 'ARS%' or .Sourcecode like 'ADSO%' or .Sourcecode like 'ARC%'))
or
((PaymentType = 'Bank Credit Transfer')
and
(.Sourcecode like 'ARS%' or Sourcecode like 'ARD%' or Sourcecode like 'ARC%'
or Sourcecode like 'ARP%' or Sourcecode like 'CV%' or Sourcecode like 'SO%' or Sourcecode = 'GO')))
IF below then use Adhoc
and not
((PaymentType = 'Standing Order' or PaymentType = 'Direct Debit' or PaymentType = 'Standing Order' or PaymentType = 'Give As You Earn' or PaymentType = 'Paperless Direct Debit')
or ((PaymentType = 'CAF Voucher' or PaymentType = 'Credit Card') and (batchdetail.Sourcecode like 'ARS%' or batchdetail.Sourcecode like 'ADSO%' or batchdetail.Sourcecode like 'ARC%'))
or ((PaymentType = 'Bank Credit Transfer') and (batchdetail.Sourcecode like 'ARS%' or batchdetail.Sourcecode like 'ARD%' or batchdetail.Sourcecode like 'ARC%'
or batchdetail.Sourcecode like 'ARP%' or batchdetail.Sourcecode like 'CV%' or batchdetail.Sourcecode like 'SO%' or batchdetail.Sourcecode = 'GO')))
Income Date | Amount | Source Code | Payment Method | Income Frequency |
26/11/2020 | 10.00 | ARSO20-01 | Credit Card | REG |
26/11/2020 | 25.00 | ADDI20-09 | Cash | Adhoc |
This would be applied to 45k lines of income monthly when imported into PowerBI
Is this even possible?
Solved! Go to Solution.
Hi @Brookied ,
You could add a conditional column in Query Editor.
Check the docement for more details.
https://docs.microsoft.com/en-us/power-query/add-conditional-column
Best Regards,
Jay
Hi @Brookied ,
You could add a conditional column in Query Editor.
Check the docement for more details.
https://docs.microsoft.com/en-us/power-query/add-conditional-column
Best Regards,
Jay
Morning, thanks for the feedback and link to video, Will give it a try now.
@Brookied , In power bi for text you have use double quotes
In power query if then else (and or ) Text.Contains and Text.Start to check starting 4 character
https://docs.microsoft.com/en-us/powerquery-m/text-contains
in DAX
if(<Logic>, <then>, <else>) Search , find. && (and) || (or) Left for first few character
Search , find - https://www.youtube.com/watch?v=mZt0HJw4gjQ
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 |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |