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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.