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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
IamTDR
Responsive Resident
Responsive Resident

Help with a Measure Total

I am looking for some advise on how I can get my sum total to foot.

I have a dimension table for the sales category, a table for my Returns %, and a total for my gross sales.

I created two simple measures, Gross_Sales=sum('sales_basis'[sales_amt]) and Returns_Ratio=sum('Returns_%_Tbl'[returns_ratio]). 

My third measure is Extrapolated_Amt(Gross_Sales*Returns_Ratio)

Everything seems to work fine except for the Extrapolated Total. Any advise? 

I will then need to create a fourth measure that will multiply against the 'Extrapolated Amt' so this total needs to be accurate.

 

Thanks in advanceCapture.PNG

1 ACCEPTED SOLUTION

add a filter

calculate(Extrapoled Amt ,filter(customer_type_tbl,not(customer_type_tbl[customer_type_desc] in {"Author"})))

Or try

sumx(,filter(values(customer_type_tbl[customer_type_desc]),not(customer_type_tbl[customer_type_desc] in {"Author"}))).[gross sales]*[5 Yr Returns Ratio])

 

Add all the values to {"Author"}

 

 

 

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Ideally, we should have sum(A) * sum(B). But as data is coming from different level we need to do a product at that level and then sum it up.

Try

sumx(values(customer[customer type]),[Gross_Sales]*[Returns_Ratio])
or
sumx(summarize(customer,customer[customer type],"_GS",[Gross_Sales],"_RR"[Returns_Ratio]),[_GS]*[_RR])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

 

Thank you so much!  That worked!

 

I also just found out that the customer type 'individual', 'author', and 'internal' should not be in the Extrapolated Amt measure.

Any suggestions on how I can filter those three customer types out of the Extrapolated Total?

I tired placing your provided measure inside a calculated measure and filter out the customer types I didnt need, but that didnt work.Capture.PNG

IamTDR
Responsive Resident
Responsive Resident

Forgot to include the measure that I am currently using.

Extrapoled Amt = sumx(values(customer_type_tbl[customer_type_desc]).[gross sales]*[5 Yr Returns Ratio])

add a filter

calculate(Extrapoled Amt ,filter(customer_type_tbl,not(customer_type_tbl[customer_type_desc] in {"Author"})))

Or try

sumx(,filter(values(customer_type_tbl[customer_type_desc]),not(customer_type_tbl[customer_type_desc] in {"Author"}))).[gross sales]*[5 Yr Returns Ratio])

 

Add all the values to {"Author"}

 

 

 

 

Perfect!  Thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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