564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
How to write queries in DAX to interrogate SSAS tabular models
Part eight of an eight-part series of blogs
As well as creating measures to aggregate data in tabular models using DAX, you can also write queries to extract data - this blog shows you how!
To wrap up this section, I thought I'd show a couple of other potentially useful DAX functions.
It can be useful when testing DAX to be able to show single values, using the ROW function. The syntax is:
The ROW function is similar to a SELECT statement in SQL run without a FROM clause.
Here's an example query, listing out the current user name, time and number of products:
-- show the current user and time
FORMAT ( NOW (), "HH:mm:ss" ),
"Number of products",
COUNT ( Product[ProductId] )
This would give these results:
This query would display these 3 bits of information.
The CONTAINS function has the following syntax, and returns TRUE or FALSE:
Here's an example of the function, showing whether there's a product called Wol with a list price of £3.95 (there is):
-- look for product with specific
-- name and price
"Does WOL exist?",
Here are the unexciting results from running this query:
A product called WOL costing £3.95 does exist in the Product table.
And on that slightly anti-climactic note, I've finished showing the DAX query syntax that I wanted to cover!
|Parts of this blog|
25 Aytoun Street