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
h4tt3n
Resolver II
Resolver II

DAX query without specific filter?

Hello,

 

I have a data table containing among other a timestamp, a numerical data value, and a data type:

 

2020-09-21 09_24_09-Ventilation Basic DEV 3 - Power BI Desktop.png

 

The data is displayed in a report:

 

2020-09-21 09_09_26-Ventilation Basic DEV 3 - Power BI Desktop.png

 

In the "Calibration" drop down menu you can see the three present datatypes. Notice the black curve over the red/green bar graph. This is data of datatype temperature, which is shown using the following DAX measure:

 

Supply temperature = calculate( selectedvalue( 'Data'[value] ), 'Data'[unittypeinputid] = 1511 )

 

What I would like to do is to always show the temperature curve no matter what datatypes are selected i the "Calibration" menu. 

 

I know there are ways to control filter context using  the filter pane and DAX filter functions, but after several hours of researching and experimenting I haven't been able to crack this nut. Any help is appreciated.

 

Thanks in advance, Mike

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Supply temperature = 
    calculate( 
        selectedvalue( 'Data'[value] ),
        'Data'[unittypeinputid] = 1511,
        ALL( 'Data'[datatype] )
    )

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Supply temperature = 
    calculate( 
        selectedvalue( 'Data'[value] ),
        'Data'[unittypeinputid] = 1511,
        ALL( 'Data'[datatype] )
    )

It works exactly as it should! @Anonymous Thanks for helping me out on this. Now comes the harder part, figuring out *how* it works...

Anonymous
Not applicable

If you read the book "The Definitive Guide to DAX" by Marco Russo and Alberto Ferrari, you'll know everything about how DAX works.

I have the book, I am just not through all of its 740 pages yet 🙂 Again, thanks for your help and time.

Anonymous
Not applicable

Just read the chapter on CALCULATE and you'll know almost everything.... at least about how this function works with filters. This is all you need in order to understand the above piece of code.
Anonymous
Not applicable

or:

Supply temperature = 
    calculate( 
        selectedvalue( 'Data'[value] ),
        'Data'[datatype] = "temperature"
    )

 

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