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.
I have a simple sales report table with a field for the date, which includes year / month / day, and I want to create a role which filters the other information by the year but don't know how to express it.
I tried to enable date heirarchy and then deselect month / day, and then express it as: [Year] = "2013"
But I am new to Power BI (and scripting language in general)
Solved! Go to Solution.
Hi @Anonymous ,
You could try to add filter like the formula below.
Measure = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date].[Year] = 2018))
Otherwise, you could create a new column of "YEAR" and then use it to filter.
YEAR = YEAR('Table'[Date])
Measure 2 = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[YEAR] = 2018))
If I understand incorrectly, please share some sample data and your expected results. Then we will unerstand clearly.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
Hi @Anonymous ,
You could try to add filter like the formula below.
Measure = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date].[Year] = 2018))
Otherwise, you could create a new column of "YEAR" and then use it to filter.
YEAR = YEAR('Table'[Date])
Measure 2 = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[YEAR] = 2018))
If I understand incorrectly, please share some sample data and your expected results. Then we will unerstand clearly.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
50 | |
46 |