Forum Discussion
Lookup sum via substring?
- 8 years ago
Hi fyip,
Based on my test, you can refer to below steps:
1.I have entered some sample data:
2.Create two measures.
Measure 4 = var s10= CALCULATE(SUM(Table1[Amount]),Table1[Acc No]=101010)
var s1020 =CALCULATE(SUM(Table1[Amount]),Table1[Acc No]=101020)
var s2010 = CALCULATE(SUM(Table1[Amount]),Table1[Acc No] = 201010)
var s201020 = CALCULATE(SUM(Table1[Amount]),Table1[Acc No]=201020)
return
IF(MAX(Table1[Acc No])=101010,s10-s2010,IF(MAX(Table1[Acc No])=101020,s1020-s201020,BLANK()))
mar = [Measure 4]/SUM(Table1[Amount])
3.Create a Table visual and add the related field and you can see the result.
You can also download the PBIX file to have a view.
https://www.dropbox.com/s/kfcegjy7o1pnvp4/Lookup%20sum%20via%20substring.pbix?dl=0
Regards,
Daniel He
Hi fyip,
could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He