Just looking at quickly, but the variable might be what is causing this issue. Variables are declared where they are defined, not where they are used. But that’s just a quick guess. What happens if you get rid of the variable and just use the expression? or define it later? Worth a shot, but if it’s still wrong can you upload the pbix file?
Hi @Nick_M, not sure how can I merge these 2 different calcs using the first approach- any hint here?
Moreover, I want to highlith that I am getting this error message when I calculate 20/80 for customers ([DUNS Group Number (Ship-To)), see below:
What is this composite thing?
Customers, coming from Ship-To table, are linked to my SPP CS Reallocation table (revenue). Therefore I would have expect to get the results using second approach - see relationships
@SamSPAIN
I havent seen that error message before? Are you using import, direct query or composite? I only really deal in import, so maybe that’s where that error is coming from…
Any chance you can upload a sample?
Hi Nick, it’s IT department in my company who is responsible to build the dataset based upon my specs.
Although not 100% sure, I’d say they use import method to query data from SAP BW onto PBI.
The PBIX is 100MB, and wouldn’t like to share hereby broadly - however, if you provide me a secure location I can certainly uploaded there so that you can check out what might be causing the issue.
As a recap - I tried to use 2nd approach within first code and didn’t work at all - any hint on how can I merge the two?
Hi @Nick_M, I’m coming back on this topic which I haven’t been able to sort it our by myself (I mean the composite key error thing)… Is there any private location where I can post the PBIX? I’m really stuck with it and need to move it forward asap.
@SamSPAIN
Not sure on the composite key error, would have to see the data model.
What I was suggesting was to just copy the formula you have defined in the variable and paste that full function where you currently have the variable. You need that function to calculate as it is being iterated, and where you have it now, it’s not being evaluated in the row context defined by the RANKX, but rather before it gets to that row.
Like to keep everything in public here, any chance you can put together a small sample file that can be uploaded, assuming the above didnt work?