Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi there,
I am having a problem where the DAX formula also applies to TOTAL row. My intent is to aggregate the values in the rows where the formula is applied, but not apply to the TOTAL row. Here is the context:
In the picture below, value in Bookings from TAM Growth = (1 + TAM Growth%) * Bookings.
Within America Geo, the value is calculated for each of the Products A - J by applying this formula.
In the TOTAL row at the bottom, the 2019 TAM, 2020 TAM are aggregated correctly, which results in a 21% TAM growth. Bookings are aggregated to 265.
However, I want the Bookings from TAM Growth to show up as 310, which is the value of the aggregation of the Product level (row) values. In PBI, what I get is 321 which is the result of applying the formula on the TOTAL row:
265 * (1 + 21% TAM growth).
Can you please let me know the DAX construct to fix this issue?
Thanks
Solved! Go to Solution.
Hi
you have to use an iterator function (SUMX) for that. This will perform the actions you've wanted: Apply the function on a row level (Product-Geo-Combination) and then add it up at the end:
SUMX(SELECTCOLUMNS(TestData,"Product", TestData[Product], "Geo", TestData[Geo]), (1+ [TAMGrowth%]) * CALCULATE(SUM(TestData[Bookings])))
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi,
Try this measure
=IF(HASONEVALUE(Testdata[Product]),[Bookings from TAM Growth],SUMX(SUMMARIZE(VALUES(Testdata[Product]),Testdata[Product],"ABCD",[Bookings from TAM Growth]),[ABCD]))
Hope this helps.
Try adding "Bookings from TAM Growth" as measure instead of column;
suposing that "TAM Growth%" is a measure, your new measur should look like :
Bookings from TAM Growth = (1+ [TAM Growth%]) * SUM(YourTable[Bookings])
That should work
That didn't work for me:
Excel (desired output):
For PBI, I have only two measures:
Here is the PBI output which shows the formula is applied for the TOTAL row as well, without aggregating the column value:
Hi,
Try this measure
=IF(HASONEVALUE(Testdata[Product]),[Bookings from TAM Growth],SUMX(SUMMARIZE(VALUES(Testdata[Product]),Testdata[Product],"ABCD",[Bookings from TAM Growth]),[ABCD]))
Hope this helps.
Thank you. This worked too!
Hi
you have to use an iterator function (SUMX) for that. This will perform the actions you've wanted: Apply the function on a row level (Product-Geo-Combination) and then add it up at the end:
SUMX(SELECTCOLUMNS(TestData,"Product", TestData[Product], "Geo", TestData[Geo]), (1+ [TAMGrowth%]) * CALCULATE(SUM(TestData[Bookings])))
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Thank you. That worked.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |