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
Anonymous
Not applicable

divide values in the same column but have different descriptions

Can some see the problem with what i wrote?
 
 
 
COD % REDUCTION =

VAR Final_Effluent =  
SUMX(
    FILTER(
    'ELS Data 2019', 'ELS Data 2019'[Analyte] = "COD"  && 'ELS Data 2019'[sample points] = "Final Effluent" ),
            AVERAGE('ELS Data 2019'[2019 results]))


var Balancing_Tank =
SUMX(
    FILTER(
    'ELS Data 2019', 'ELS Data 2019'[Analyte] = "COD"  && 'ELS Data 2019'[sample points] = "Balance Tank" ),
            AVERAGE('ELS Data 2019'[2019 results]))

Return

    IF(
        NOT ISBLANK(Final_Effluent),
        ABS(DIVIDE( Final_Effluent-Balancing_Tank, Balancing_Tank)
    )
)
1 ACCEPTED SOLUTION

@Anonymous one issue i found tht you used value "Balance Tank" where as in your data it is "Balancing Tank" and your measure was returning any value, here is the measure

 

COD % REDUCTION = 

VAR Final_Effluent = CALCULATE( AVERAGE( Sheet1[2019 results] ), Sheet1[Analyte] = "COD", Sheet1[sample points] = "Final Effluent" )
var Balancing_Tank = CALCULATE( AVERAGE( Sheet1[2019 results] ), Sheet1[Analyte] = "COD", Sheet1[sample points] = "Balancing Tank" ) Return IF( NOT ISBLANK(Final_Effluent), ABS(DIVIDE( Final_Effluent-Balancing_Tank, Balancing_Tank) ) )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous are you getting wrong result or what is the issue? Can you share sample data and expected result?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

basically im not gettin any numbers back
all the results should be between 80- 95 %

Description Sample Date 2019 results sample points Analyte

BT-PackagingPlant 02011902/01/20191098BTCOD
BT-PackagingPlant 09011909/01/2019346BTCOD
BT-PackagingPlant 23011923/01/2019492BTCOD
BT-PackagingPlant 16011916/01/2019702BTCOD
Balancing Tank 24011924/01/2019630Balancing TankCOD
Balance Tank08/01/2019104Balancing TankBOD
Balancing Tank 08011908/01/201925.2Balancing TankTotal Nitrogen
Balancing Tank 17011917/01/20191340Balancing TankCOD
Balancing Tank 18011918/01/2019850Balancing TankCOD
Balancing Tank 13011913/01/20191190Balancing TankCOD
Balancing Tank 09011909/01/20191190Balancing TankCOD
Balancing Tank 21011921/01/20191140Balancing TankCOD
Balancing Tank 20011920/01/2019850Balancing TankCOD
Balancing Tank 08011908/01/20191710Balancing TankCOD
Balancing Tank 22011922/01/2019830Balancing TankCOD
Balance Tank22/01/2019168Balancing TankBOD
Balancing Tank 23011923/01/2019940Balancing TankCOD
Balancing Tank 10011910/01/20191650Balancing TankCOD
Balancing Tank 22011922/01/201922.9Balancing TankTotal Nitrogen
Balancing Tank 19011919/01/2019830Balancing TankCOD
Balancing Tank 11011911/01/20191550Balancing TankCOD
Balancing Tank 04011904/01/2019440Balancing TankCOD
Balancing Tank 14011914/01/20191230Balancing TankCOD
Balancing Tank 12011912/01/20191310Balancing TankCOD
Balancing Tank 03011903/01/2019550Balancing TankCOD
Balancing Tank 15011915/01/201924.4Balancing TankTotal Nitrogen
Balancing Tank 02011902/01/2019580Balancing TankCOD
Balancing Tank 15011915/01/20191460Balancing TankCOD
Balancing Tank 15011915/01/201915Balancing TankBOD
Balancing Tank 16011916/01/20191190Balancing TankCOD
Final Effluent 23011923/01/201976Final EffluentCOD
Final Effluent 24011924/01/201929Final EffluentCOD
Final Effluent 13011913/01/20198Final EffluentCOD
Final Effluent 22011922/01/201917.6Final EffluentTotal Nitrogen
Final Effluent 16011916/01/201934Final EffluentCOD
Final Effluent 17011917/01/201940Final EffluentCOD
Final Effluent 18011918/01/201938Final EffluentCOD
Final Effluent 15011915/01/20199.6Final EffluentTotal Nitrogen
Final Effluent 15011915/01/201944Final EffluentCOD
Final Effluent 19011919/01/201927Final EffluentCOD
Final Effluent 21011921/01/201931Final EffluentCOD
Final Effluent 20011920/01/201928Final EffluentCOD
Final Effluent 22011922/01/201990Final EffluentCOD
Final Effluent 08011908/01/201951Final EffluentCOD
Final Effluent 09011909/01/201976Final EffluentCOD
Final Effluent 10011910/01/201966Final EffluentCOD
Final Effluent 08011908/01/201912.9Final EffluentTotal Nitrogen
Final Effluent 04011904/01/20198Final EffluentCOD
Final Effluent 30121830/12/201851Final EffluentCOD
Final Effluent 12011912/01/201942Final EffluentCOD
Final Effluent 02011902/01/201953Final EffluentCOD
Final Effluent 11011911/01/201971Final EffluentCOD
Final Effluent 14011914/01/201919Final EffluentCOD
Final Effluent 03011903/01/201942Final EffluentCOD
Quench Liquor 23011923/01/201919.4QuenchTotal Nitrogen
Quench Liquor 09011909/01/201914.6QuenchTotal Nitrogen
Quench Liquor 16011916/01/201915.5QuenchTotal Nitrogen
Clear Effluent 08011908/01/20198.8clear effluentTotal Nitrogen
Clear Effluent 22011922/01/201915.8clear effluentTotal Nitrogen
Clear Effluent 08011908/01/201946clear effluentCOD
Clear Effluent 15011915/01/201949clear effluentBOD
Clear Effluent22/01/20195clear effluentBOD
Clear Effluent 15011915/01/201933clear effluentCOD
Clear Effluent 15011915/01/20197.3clear effluentTotal Nitrogen
Clear Effluent08/01/201947clear effluentBOD
Clear Effluent 22011922/01/2019106clear effluentCOD
Surface Water 02011902/01/20198surface waterCOD
Surface Water 09011909/01/20198surface waterCOD
Surface Water 16011916/01/201914surface waterCOD
Surface Water 23011923/01/201950surface waterCOD


graph.PNG

@Anonymous can you share data thru excel, share thru one drive/google drive.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

https://drive.google.com/file/d/1ufPk06-8YLIvDRpym99rM9ap07iSkX9l/view?usp=sharing


@parry2k wrote:

@Anonymouscan you share data thru excel, share thru one drive/google drive.


 

@Anonymous one issue i found tht you used value "Balance Tank" where as in your data it is "Balancing Tank" and your measure was returning any value, here is the measure

 

COD % REDUCTION = 

VAR Final_Effluent = CALCULATE( AVERAGE( Sheet1[2019 results] ), Sheet1[Analyte] = "COD", Sheet1[sample points] = "Final Effluent" )
var Balancing_Tank = CALCULATE( AVERAGE( Sheet1[2019 results] ), Sheet1[Analyte] = "COD", Sheet1[sample points] = "Balancing Tank" ) Return IF( NOT ISBLANK(Final_Effluent), ABS(DIVIDE( Final_Effluent-Balancing_Tank, Balancing_Tank) ) )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

Top Solution Authors