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.
Hi,
can somebody please help me out here.
[Total] is a measure (a simple Sum(Revenue) )
Calendar is a calendar table. There is a relationship between the calendar table and the revenue table
This works:
Total this year =
VAR vYear = 2020
RETURN
CALCULATE([Total], 'Calendar'[Year] = vYear)
Gives me the correct number
But this doesn't:
Total this year =
VAR vYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE([Total], 'Calendar'[Year] = vYear)
The result of this is (BLANK)
I have a slicer where the user can select only one year, no multi select.
Thank you in advance
Solved! Go to Solution.
@whereismydata , first of all if they are related then
CALCULATE([Total]) should get the filter
or try like
Total this year =
VAR vYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE([Total], filter('Calendar','Calendar'[Year] = vYear))
or
Total this year =
VAR vYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE([Total], filter(all('Calendar'),'Calendar'[Year] = vYear))
Hi @amitchandak
I was using filter(all ....) before, but it didn't work. Tried it again and now it works. Should call it a day 😄
Thank you for taking the time looking at my problem!
Best
@whereismydata , first of all if they are related then
CALCULATE([Total]) should get the filter
or try like
Total this year =
VAR vYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE([Total], filter('Calendar','Calendar'[Year] = vYear))
or
Total this year =
VAR vYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE([Total], filter(all('Calendar'),'Calendar'[Year] = vYear))
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 |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |