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
ja342
Frequent Visitor

Divide sums across two tables

Hello, I am trying to create a new measure (or table) to output of the summation of 'Table1 BCM' divided by summation of 'Table2 SMU Hrs' by 'Dig Unit #' type as a filter.

 

I tried using this but got an error message saying cannot convert value of type text to type true/false.

 

BCM / hr Rate =
VAR BCM = CALCULATE(
SUM('Table1'[BCM]),
FILTER (Table1, Table1[Dig Unit #] ))

VAR SMU = CALCULATE(
SUM('Table2'[SMU Hrs]),
FILTER ('Table2', 'Table2'[Dig Unit #]))
RETURN
    DIVIDE(BCM,SMU)
3 REPLIES 3
amitchandak
Super User
Super User

@ja342 , what are you trying to filter

FILTER (Table1, Table1[Dig Unit #] )

give some value

FILTER (Table1, Table1[Dig Unit #]  = "ABC")

or

FILTER (Table1, Table1[Dig Unit #] = related(Table2[Dig Unit #] ))

I am trying to create a visual table that looks like this:

Dig Unit #BCM / hr DayBCM / hr Night
Ex11,250..
Ex2

1,230

..
Ex2....

 

The values inside this table is what I am trying to sum from two different tables.  The BCM value is in table 1 and Hr values are in table 2.  Both of which need to be summed up for this summary table above.  I tried merging queries and using relationships neither of which seemed to produce result needed.

az38
Community Champion
Community Champion

Hi @ja342 

you need to compare Table1[Dig Unit #] and 'Table2'[Dig Unit #] with something inside FILTER()

Now, it has completely incorrect syntax


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.