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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
diedrich08
Frequent Visitor

Measure Comparing All Unique Values in Table Column When Using IF Function - DAX

Hello, 

 

I am attempting to complete a measure and add as column to compare the "Concentration" to a guideline which is in another table.

 

I have the following table:

 

DateWellParameterConcentration
01/07/2016 0:00MO_MW1Benzene0.003943
01/07/2016 0:00MO_MW2Benzene0.005292
01/07/2016 0:00MO_MW3Benzene0.0005
01/07/2017 0:00MO_MW1Benzene0.027705
01/07/2017 0:00MO_MW2Benzene0.030111
01/07/2017 0:00MO_MW3Benzene0.0005
01/07/2018 0:00MO_MW1Benzene0.005625
01/07/2018 0:00MO_MW2Benzene0.018283
01/07/2018 0:00MO_MW3Benzene0.0005
01/07/2016 0:00MO_MW1Chloride10.42321
01/07/2016 0:00MO_MW2Chloride22.95381
01/07/2016 0:00MO_MW3Chloride37.10764
01/07/2017 0:00MO_MW1Chloride46.84721
01/07/2017 0:00MO_MW2Chloride75.34789
01/07/2017 0:00MO_MW3Chloride48.45198
01/07/2018 0:00MO_MW1Chloride10.41973
01/07/2018 0:00MO_MW2Chloride24.55236
01/07/2018 0:00MO_MW3Chloride18.30098

 

The script I am using is:

 

 

Exceed_Chem = 
var
GL = CALCULATE(MINX('Guidelines','Guidelines'[Value]),filter('Guidelines','Guidelines'[Parameter]=SELECTEDVALUE('Chemistry'[Parameter])))

Var
Conc = SELECTEDVALUE('Chemistry'[Concentration])

Return
if(Conc>GL,"TRUE","FALSE")

This is used so that both the exceedances and non-exceedances are flagged; however, when I use this fuction, I get a table that appears to loop through unique values in the selected column of the table. For example, I have one benzene measurement on 01/07/2016 at BV_MW1, but I am having 2 values provided in the summary table (0.0005 and 30.3). To clarify, the 30.3 is a chloride concentration from the original table that I filtered out of the original table to keep the post shorter.

 

 

 

DateWellParameterConcentrationExceed_Chem
01/07/2016 0:00BV_MW1Benzene0.0005FALSE
01/07/2016 0:00BV_MW1Benzene30.27886FALSE

 

Can any provide any insights why this is happening and what i can do to resolve? 

 

Thanks!

 

Diedrich

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

@diedrich08 ,

 

Take a look at Change how a numeric field is aggregated and try using SUM instead of SELECTEDVALUE.

Community Support Team _ Sam Zha
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

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@diedrich08 ,

 

Take a look at Change how a numeric field is aggregated and try using SUM instead of SELECTEDVALUE.

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.