Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Wondering what change is needed to the query below. Trying to add a 'where' clause to the working query.
The first commented bit of the filter is what I want. The other lines are failing tests.
Simple dataset table
The dax query
EVALUATE
FILTER (
SELECTCOLUMNS (
'CPP Traffic Light Short Status',
"Short Status Name", 'CPP Traffic Light Short Status'[Short Status Name],
"Unichar Glyph", UNICHAR ('CPP Traffic Light Short Status'[Unicode Decimal]),
"Colour Hex", 'CPP Traffic Light Short Status'[Colour Hex],
"Font Size", 'CPP Traffic Light Short Status'[Font Size],
"Font Size Offset", 'CPP Traffic Light Short Status'[Font Size Offset]
),
-- 'CPP Traffic Light Short Status'[Status Code] IN {0, 1, 2, 3, 10}
-- MAX('CPP Traffic Light Short Status'[Status Code]) = 0
MAX('CPP Traffic Light Short Status'[Short Status Name]) = "Not Reported"
)
ORDER BY [Short Status Name]
Solved! Go to Solution.
Replace filter with calculatetable command :}
EVALUATE
-- FILTER (
CALCULATETABLE (
SELECTCOLUMNS (
'CPP Traffic Light Short Status',
"Short Status Name", 'CPP Traffic Light Short Status'[Short Status Name],
"Unichar Glyph", UNICHAR ('CPP Traffic Light Short Status'[Unicode Decimal]),
"Colour Hex", 'CPP Traffic Light Short Status'[Colour Hex],
"Font Size", 'CPP Traffic Light Short Status'[Font Size],
"Font Size Offset", 'CPP Traffic Light Short Status'[Font Size Offset]
),
'CPP Traffic Light Short Status'[Status Code] IN {0, 1, 2, 3, 10}
-- 'CPP Traffic Light Short Status'[Status Code] = 0
-- 'CPP Traffic Light Short Status'[Short Status Name] = "Not Reported"
)
ORDER BY [Short Status Name]
Ok so how to make the filter command work for my scenario?
Replace filter with calculatetable command :}
EVALUATE
-- FILTER (
CALCULATETABLE (
SELECTCOLUMNS (
'CPP Traffic Light Short Status',
"Short Status Name", 'CPP Traffic Light Short Status'[Short Status Name],
"Unichar Glyph", UNICHAR ('CPP Traffic Light Short Status'[Unicode Decimal]),
"Colour Hex", 'CPP Traffic Light Short Status'[Colour Hex],
"Font Size", 'CPP Traffic Light Short Status'[Font Size],
"Font Size Offset", 'CPP Traffic Light Short Status'[Font Size Offset]
),
'CPP Traffic Light Short Status'[Status Code] IN {0, 1, 2, 3, 10}
-- 'CPP Traffic Light Short Status'[Status Code] = 0
-- 'CPP Traffic Light Short Status'[Short Status Name] = "Not Reported"
)
ORDER BY [Short Status Name]
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |