July 18, 2019 at 1:44 pm #18052
I’m a rookie about PowerPivot and I’m trying to develop a tool by using DAX formulas but stuck at some point.
Attached you will find the data structure that I’m working on: there are 3 “Tables” named Opp, Users, KPI and there are relationships between tables. (e.g. ‘Opp[Opp_Owner] column is related with ‘Users[Full_Name] )
What I’d like to do with PowerPivot is to calculate targets by following a rational which I’ll describe later and write it to ‘Users [Target1] and ‘Users[Target2], in attacted excel I filled it with yellow. What formula needs to do is to;
- Look at ‘Users[Division]
- if it is “AE” bring ‘Users[Full_Name] and count ‘Opp[Opp_Owner] return a number e.g. for Leo Marc 3
- multiply it with the corresponding number at ‘KPI[Target1]. e.g. for AE with 5
- if the [Division] is not “AE” but something at ‘KPI[Division] it will multiply the outcome with a constant 10 (e.g. 30*10 for SR)
- else 0
What I was able to write so far is nearly nothing 🙂 it seems like below:
=IF(‘User DivMap'[DivisionAdj]=”AE”,??????????,LOOKUPVALUE(Table1[Visits],Table1[Division],’User Div Map'[Division Adj])*10)
Which functions together I need to use in order to make it possible?
Your help is very much appreciated.July 18, 2019 at 3:06 pm #18054
- Started: 7
- Replies: 2566
- Total: 2573
The biggest issue you are facing is that you are thinking like an Excel user, not a Power Pivot user.
In a model with the 3 related tables you describe, the formula for a calculated column (not a measure) is:
Users[Division] = “AE”,
COUNTROWS ( RELATEDTABLE ( Opp ) ) * RELATED ( ‘KPI'[Target1] ),
NOT ( ISBLANK ( RELATED ( ‘KPI'[Division] ) ) ),
RELATED ( ‘KPI'[Target1] ) * [Constant],
I strongly recommend reading a basic Power Pivot book, such as “Power Pivot and Power BI” by Rob Collie or “Supercharge Excel” by Matt Allington. Both authors offer practical courses in Power Pivot, and I also recommend you choose one of them. These actions will save you from many hours of grief.
Please see attached workbook (yours, modified).July 19, 2019 at 6:20 am #18060
Thank you very much. This was actually my first Power Pivot study which I had to use Power Pivot in order to reach my study goal because otherwise the workbook is getting very non-user friendly. I’ll start with the books that you recommend to me.
Very much appreciated and see you in forums 🙂July 25, 2019 at 10:49 am #18093
This might not directly related with Power Pivot but an issue has been occured when I’d like to “show items with no data”.
My target fields are populated by a using the formula as discussed above but the names are repeating when I activate “show items with no data” and looks like attached. Normally it should look like:
Name Div Adj. Visit_Target Call_Target Opp_Count
A AE 15 15 5
B SR 50 75 10
C AE 0 0 0 (when show items with no data activated)
Is this about the relationships between tables and the directions of them maybe?
Thanks a lot in advance!
- Look at ‘Users[Division]
You must be logged in to reply to this topic.