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
rsanyoto
Helper III
Helper III

Measure multiple variable to return values

Hi guys,

 

I have a challenge to return the right output based on the cost amount of a machine.

 

The current measures are :

Cost Amount MachineType = SUM(MachineTypeKosten[Cost Amount])
Machine worked time in hour  = SUM(Fact_MachineRegistratie[Duration]) / 60
Wrong = [Cost Amount MachineType] * [Machine worked time in hour]
 
 
The current output in a table looks like this:
 measurevar1.PNG
  it seems that the multiply doesnt work on every row because  i expect on the first row 175 and not 350.
 
Any suggestion?
 
 
 
Many thanks
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@rsanyoto , You need to force a row context

like

sumx(summarize(Table, Table[StartingDatetime],"_1", [Cost Amount MachineType] * [Machine worked time in hour]),[_1])

 

not sure which table StartingDatetime belongs so used Table. You need to use one or more columns in summarize to group the data at the lowest level where you need to multiply these two

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@rsanyoto , You need to force a row context

like

sumx(summarize(Table, Table[StartingDatetime],"_1", [Cost Amount MachineType] * [Machine worked time in hour]),[_1])

 

not sure which table StartingDatetime belongs so used Table. You need to use one or more columns in summarize to group the data at the lowest level where you need to multiply these two

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.