Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
dharsanj
Helper II
Helper II

How not to apply product formula in the Total

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

 

How to get the TOTAL value in Bookings from TAM Growth to match DesiredHow to get the TOTAL value in Bookings from TAM Growth to match Desired

2 ACCEPTED SOLUTIONS

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

View solution in original post

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
nlouahedj
New Member

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):

Excel.png

 

For PBI, I have only two measures:

TAMGrowth% = CALCULATE(SUM(TestData[2020 TAM])/SUM(TestData[2019 TAM])-1)
Bookings from TAM Growth = (1+ [TAMGrowth%]) * SUM(TestData[Bookings])

 

Here is the PBI output which shows the formula is applied for the TOTAL row as well, without aggregating the column value:

PBI Ouput1.png

 

 

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.