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.
I'm using the approach below to filter a table for a specific value (knowing the result is unique) by using Firstnonblank.
Are there any approaches that are more effecient to achieve the same? I'm checking if the line returned contains the value "vrijgegeven" in the particular column.
Hello,
if you're 100% sure the result will be unique with those filters, you could use another aggregation as well (or no aggregation at all):
CALCULATETABLE (
VALUES/DISTINCT/MIN/MAX ( VrijgaveCompleetheid[crc06_vrijgavestatus] ),
<filters>
) = "Vrijgegeven"
This should work as well, without the need of using FIRSTNONBLANK.
However, be aware of the fact that VALUES will raise an error in the result is not unique (i.e. if you have two or more rows as a result). In that case, an aggregator like MIN/MAX would do the trick
Please let me know if this helps 🙂
Thanks for sharing your approach Amedeo, this works indeed.
I assuming for now that using firstnonblank in this particular case is not "wrong". I actually felt that there must me be a more suitable approach for this simple task.
For optimization of LASTNONBLANK and similar functions, please see Optimizing LASTNONBLANK and LASTNONBLANKVALUE calculations - SQLBI.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |