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.
Hello,
I've several quite simple DAX aggregations measures such as :
EXPENSES_2022=CALCULATE(measures[EXPENSES], data[YEAR]=2022)
I'd like to use a "variable" instead of 2022 which can be shared between several measures and evolve automatically when we have year changes, so I created a measure :
YEAR_N = MAX(data[YEAR])
I tried this :
EXPENSES_MAX=CALCULATE(measures[EXPENSES], data[YEAR]=global_VARIABLES[YEAR_N])
I got an error message (something talking about PLACEHOLDER instead of boolean value ...).
on the forum, I found something about adding filter function So , my new formula became :
EXPENSES_MAX=CALCULATE(measures[EXPENSES], FILTER(data,data[YEAR]=global_VARIABLES[YEAR_N]))
technically, I've a result, but the calculation gives me much more data (I don't understant yet where it comes from). Do you know what consequences the use of FILTER can have in the calculation (suppressing others filters etc ...)
regards
Before you start creating calculations, you should read something upon CALCULATE: Introducing CALCULATE in DAX - SQLBI
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |