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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Creating a measure to divide a column by a measure

Hi All,

 

I have created a measure that allows me to see the total sales for all stores that have a rate that is not blank.  This report will be focused on a region, so a slicer will decide which region will be showing.  Now, I would like to divide the stores that are not blank's total sales by the total for the region.  This will leave me with a percent of the of the sales that are reporting rates for each store that is reporting a rate.

 

Here's my first measure to get the total sales of stores that do not have a blank rate: 

Weighted Total = (CALCULATE(SUM('Main'[Total Sales]),FILTER(Main,VALUE('Main'[Total Rate])<> BLANK())))
 
StoreTotal SalesTotal RateRegion

A

100.021
B150.041
C125.021
D50-1
E100-1
F200.072
G110.012
H60-2
I75.052
 
 In the sample data, my first measure would exclude stores D & E for Region 1, and the total sales would be 375.  I would then want to add a column to this table that would divide the store's total sales (if they reported a rate) by the regional total.  For example, it would do the 100/375 calculation for Store A and leave me with 27%. in another column in the table.
 
Thanks in advance
2 REPLIES 2
AlexisOlson
Super User
Super User

Just to be clear, you cannot use slicer selections in a calculated column. Calculated columns and calculated tables cannot be responsive to slicers since they are only computed once per data load.

Anonymous
Not applicable

I think I misspoke a bit in the last paragraph.  I'm not looking for a calculated column, but rather using a table visual to display this data.  I would want to add that measure as a field in my table visual.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors