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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Greenwoodr
Helper I
Helper I

measure values same on each row

Hi, 

 

I have an issue around the context of calculated measures which I am struggling to get my head around.

 

I have the following

 

1. Fact table (sales)

    Customer ID

    Date ID

    ProductID

    Leads Flag (0,1)

    Sales Flag (0,1)

2. Date Dimension

    DateID

   [Various date variables]

3. Seller Table

   SellerID

 Sellers Name

4. Customer table

   CustomerID

   PhoneNumberFlag (contains 0s & 1s)

 

   This allows me to create the following table by product and date range (i.e Weeknum):

 

Seller       Count leads    count Sale     Percentage(measure)

Bob             10                    8                      80%

Dave             2                     1                      50

 

measure = Sum(sales)/sum(leads)

 

I need to know how many leads have a phone number  . However when I do this I get the same answer across all rows of the table and am therefore igoring the filter context of the table

 

Seller       Count leads    count Sale     Percentage(measure)    sum of PhoneNumberFlag

Bob             10                    8                      80%                               80000

Dave             2                     1                      50                                 80000

 

sum of PhoneNumberFlag = calculate(sum('Customer table'[PhoneNumberFlag]))

 

How do I ensure this measure is in the context of the Table in the report?

 

Many Thanks

 

1 ACCEPTED SOLUTION

Hi,

 

I have been playing and Cross directional filtering on the customer table seems to give me the right answer.

Thanks for your time

 

View solution in original post

8 REPLIES 8
themistoklis
Community Champion
Community Champion

@Greenwoodr

 

CALCULATE function needs to be used in combination with a FILTER or All/Allexcept/Allselected function.

 

Any chance to share the file with us or send us some sample data and the expected output?

 

e.g.

PhoneNumberFlag = calculate(sum('Customer table'[PhoneNumberFlag]), ALLEXCEPT('Seller Table', 'Seller Table'[Seller Name]))

Fact TableFact TableOther TablesOther TablesOther TablesOther TablesBI DesignBI DesignActual OutputActual OutputIDesired OutputDesired Output

Hi,

 

I have been playing and Cross directional filtering on the customer table seems to give me the right answer.

Thanks for your time

 

Hi,

 

I have been playing and Cross directional filtering on the customer table seems to give me the right answer.

Thanks for your time

 

Fact TableFact TableOther TablesOther TablesOther TablesOther TablesBI DesignBI DesignActual OutputActual OutputIDesired OutputDesired Output

Thanks. 

 

I have recreated the problem and put the tables data in Excel - what is the best way to share it?

Richard

@Greenwoodr

 

You can use dropbox, onedrive, googledrive,.... or e.g. wetransfer.com

I have put some screen shots of the problem if that helps.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors