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.
Hello guys,
I am struggling to show the correct dates of a measure that represents the value of 12 followed months of the first year registered in the date table, for instance: I have dates registired of 1/2019 until 1/2016, and this measure only calculates values of 2019 until 2018. But when I put this measure and the date column in a single table, the column of the date shows the values of the measure even out of the period I specified in the measure, here is the measure above
@Anonymous ,
Do you mean that you wants to get the values of last 12 months based on registered date, in this scenario, we can create a calendar table using dax(Table 2= Calendar("1/1/2016","12/31/2019")) and then create a measure as below. After that, drag date field of bill table and the measure in a table visual.
LAST12MONTHS = var thisdate = LASTDATE('Table 2'[Date]) var lastyeardate = DATEADD(LASTDATE('Table 2'[Date]),-1,YEAR) return CALCULATE(SUM(Bills[yourfield]), DATESBETWEEN(Bills[Date],lastyeardate,thisdate))
If the above DAX doesn’t help, could you please share the target result to us? You can share some sample data and target result as an example.
Regards,
Lydia
I tried using that, but the measure itself brings an error saying that a MONTH,YEAR, QUARTER is necessary as a argument
@Anonymous ,
Would you mind sharing your PBIX file containing dummy data?
Regards,
Lydia
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |