alfranco17
Board Regular
- Joined
- Apr 14, 2013
- Messages
- 198
Hi.
I have just discovered Power Pivots. I think DAX can solve an issue I have with regular Pivot tables.
I have to create a report that divides all amounts for a given month between the total income amount for that month. I almost get it with a regular Pivot Table.
http://www.auval.com.mx/images/1Mess.JPG
I can copy those values and format and fix the % with a formula per column.
http://www.auval.com.mx/images/1Need.JPG
Trying to use a Power Pivot, I created a new column called "Income only" in the linked table, with the formula =CALCULATE(SUM(Financial[Amount]),Financial[Type]="Income")
Then tried to get the sum of this new column on all the items on the table filtered by the month in the column with this measure:
=CALCULATE(SUM(Financial[Amount]),Financial[Type]="Income", filter(ALL(Financial),Financial[Month]=[month]))
The issue I have is that ALL removes the filter for all items, and then my filter gets ignored and always gets the total sum (635, instead of either 315 for Jan or 320 for Feb). (Or maybe my real issue is that my logic is just plain wrong.)
Is there a way to include the month name in the calculation, or a formula that does the trick?
Thanks for your help!
Armando.
I have just discovered Power Pivots. I think DAX can solve an issue I have with regular Pivot tables.
I have to create a report that divides all amounts for a given month between the total income amount for that month. I almost get it with a regular Pivot Table.
http://www.auval.com.mx/images/1Mess.JPG
I can copy those values and format and fix the % with a formula per column.
http://www.auval.com.mx/images/1Need.JPG
Trying to use a Power Pivot, I created a new column called "Income only" in the linked table, with the formula =CALCULATE(SUM(Financial[Amount]),Financial[Type]="Income")
Then tried to get the sum of this new column on all the items on the table filtered by the month in the column with this measure:
=CALCULATE(SUM(Financial[Amount]),Financial[Type]="Income", filter(ALL(Financial),Financial[Month]=[month]))
The issue I have is that ALL removes the filter for all items, and then my filter gets ignored and always gets the total sum (635, instead of either 315 for Jan or 320 for Feb). (Or maybe my real issue is that my logic is just plain wrong.)
Is there a way to include the month name in the calculation, or a formula that does the trick?
Thanks for your help!
Armando.