The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I would like to filter based on Category but category changes each year. Can I do that in measure?
I hope it's clear from the picture.
Thanks.
B.
Solved! Go to Solution.
@kap_55 Create following measure in source table
Measure =
VAR _year = MAX(Source[Year])
VAR _color = CALCULATETABLE(VALUES(Mapping[Category]),Mapping[Year]=_year)
RETURN CALCULATE(SUM(Source[Value]),Source[Category] IN _color)
As per my understanding 2017 sum of value should be 7.
@kap_55 Create following measure in source table
Measure =
VAR _year = MAX(Source[Year])
VAR _color = CALCULATETABLE(VALUES(Mapping[Category]),Mapping[Year]=_year)
RETURN CALCULATE(SUM(Source[Value]),Source[Category] IN _color)
As per my understanding 2017 sum of value should be 7.
Works awesome. Thanks.
Yes. My mistake 🙂
Let me try your solution.
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
14 | |
14 | |
9 | |
7 |