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

Hi experts, i have data in Data base as shown in below, i want to create a measure as below

Ganesh31_0-1673410372661.png

i have a data in sql as show in above figure, now i want to make a measure in power bi by taking only few coloumns such as  

measure = (shed1 po washing line *3) + (shed2 - Dynamic-PCU * 4) 

 

how to do that please suggest the way to that!

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Ganesh31 ,

You can create a measure as below to get it, please find the details in the attachment.

Measure =
VAR _shed1 =
    CALCULATE (
        SUM ( 'Table'[Consumption] ),
        'Table'[Meter] = "Shed1-PO Washing Line"
    )
VAR _shed2 =
    CALCULATE ( SUM ( 'Table'[Consumption] ), 'Table'[Meter] = "Shed2-Dynamic-PCU" )
RETURN
    _shed1 * 3 + _shed2 * 4

yingyinr_0-1673512241855.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Ganesh31 ,

You can create a measure as below to get it, please find the details in the attachment.

Measure =
VAR _shed1 =
    CALCULATE (
        SUM ( 'Table'[Consumption] ),
        'Table'[Meter] = "Shed1-PO Washing Line"
    )
VAR _shed2 =
    CALCULATE ( SUM ( 'Table'[Consumption] ), 'Table'[Meter] = "Shed2-Dynamic-PCU" )
RETURN
    _shed1 * 3 + _shed2 * 4

yingyinr_0-1673512241855.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
VijayP
Super User
Super User

Lets us asume your table name is Table

then the formula will be

Calculate ( sum(Table[consumption]), Filter(all(Table[Meter]), Table[Meter]=" shed 1 " || table[meter] = "shed 2]))*3




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


VijayP
Super User
Super User

@Ganesh31 

You must be more clear !

Do you want the value of consumption of Shed1 multiplied by 3 and if you can give a business objective , will help me to answer you!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


yes,i want to create a measure by taking only few rows out of whole data

 

measure = (shed 1's Consumption *3)+(shed 2's consumption*4)

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.