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, I need to create 2 measures (to be inserted in a table) based on a data "Sales" that I currently have for each single month of the current year:
measure 1 - sales from 1 January current year to today's date
measure 2 - sales of the current month only
How can I do?
thanks to who helps me.
Solved! Go to Solution.
@Morgana_2022 do you have a date dimension table?
If yes, then:
measure 0 = SUM('Table'[Sales])
measure 1 = CALCULATE([measure 0], DATESYTD('Date'[Date'))
measure 2 =
VAR _current_month = SELECTEDVALUE('Date'[Month-Year])
RETURN
CALCULATE(
[measure 0],
REMOVEFILTERS('Date'),
'Date'[Month-Year] = _current_month
)
@Morgana_2022 do you have a date dimension table?
If yes, then:
measure 0 = SUM('Table'[Sales])
measure 1 = CALCULATE([measure 0], DATESYTD('Date'[Date'))
measure 2 =
VAR _current_month = SELECTEDVALUE('Date'[Month-Year])
RETURN
CALCULATE(
[measure 0],
REMOVEFILTERS('Date'),
'Date'[Month-Year] = _current_month
)
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |