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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

DAX mesaure : calculation of a value according to a measure

Hello everyone,

Today I am asking you about a DAX measure. Indeed, for the calculation of a measure I need a variable. This variable is the turbidity value when the trubidity frequency in% between 0.20% and 0.21%:

image.png

The frequency calculation is a measure, here is the code:

image.png

Here is the code for the turbidity measurement:

image.png

What is the formula to fill in for the calculation of this variable please?

Thanks in advance,

Joel

1 ACCEPTED SOLUTION
edhans
Super User
Super User

It works for me @Anonymous so maybe I am not understanding what you expect the results to be. Remember, I know nothing about your data and without googling, I don't know what turbidity means. I've heard the term, but couldn't intelligently use it in a sentence. I am an accountant, not a scientist. So if this isn't what you need, explain the logic of how to get what you want and then we will see if we can write a measure that does that.

 

 

Some Measure = 
    MAXX(
        FILTER(
            ALL( Data ),
            Data[Fréquence turbidité (%)] > .20
                && Data[Fréquence turbidité (%)] < .21
        ),
        Data[Turbidité]
    )

 

 

 

2021-01-08 09_01_28-Untitled - Power BI Desktop.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

6 REPLIES 6
edhans
Super User
Super User

Glad I was able to help @Anonymous 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
edhans
Super User
Super User

It works for me @Anonymous so maybe I am not understanding what you expect the results to be. Remember, I know nothing about your data and without googling, I don't know what turbidity means. I've heard the term, but couldn't intelligently use it in a sentence. I am an accountant, not a scientist. So if this isn't what you need, explain the logic of how to get what you want and then we will see if we can write a measure that does that.

 

 

Some Measure = 
    MAXX(
        FILTER(
            ALL( Data ),
            Data[Fréquence turbidité (%)] > .20
                && Data[Fréquence turbidité (%)] < .21
        ),
        Data[Turbidité]
    )

 

 

 

2021-01-08 09_01_28-Untitled - Power BI Desktop.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

Hello @edhans  and sorry for my response time.

Your formula was good it is in the choice of the table after "ALL (TABLE)" that I had not chosen the right data. Indeed my file is split into grouping of measures according to time intervals like this:

image.png

After choosing the right time interval your code worked perfectly!
Thanks again and have a nice day,

Joel

edhans
Super User
Super User

@Anonymous - did that help at all?

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
edhans
Super User
Super User

A measure like this should work @Anonymous 

 

Some Measure =
VAR varCurrentTurbidityFreq =
    MAX( 'Table'[TurbidityFreq] )
RETURN
    MAXX(
        FILTER(
            ALL( 'Table' ),
            'Table'[TurbidityFreq] > .20
                && 'Table'[TurbidityFreq] < .21
        ),
        'Table'[Turbidity]
    )

 

I didn't test it though. You'd need to provide some test data. We cannot work with screenshots for test data, I'd have to key all of that in.

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

Hello @edhans,

Sorry for my response time.
Here is an excerpt of my PBIX in CSV format.
Thank you for your formula, unfortunately it does not work.
I hope the CSV file will bring more details.

Thank you in advance,

Joël

https://1drv.ms/x/s!Ao1OrcTeY008gYUuuekGNOgd2j11NA?e=NWzVkK 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.