Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have a dashboard with a slicer to select the period (1 or 2) and the year. You can make two selections in this slider, so for example 2 2023 and 1 2024. In that dashboard I have the following table:
Name Period Year Period-Year-code Value Change
Item 1 2 2023 2 25
Item 1 1 2024 3 15 Lower
So what I'm looking for is the change value that is in the last column. For every selection you make in the slicer there will be two results with the same name, only the period-year-value are different. Im struggeling to come up with a logic that would work for this. Hopefully anyone has an idea how to calculate this. Thanks!
Solved! Go to Solution.
@Roym , If you have date or create date using year and month
Date = Date([Year], [Month], 1)
Join with Date of date table and use time intelligence
then you can have measure like that have diff measure
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
Or you can measure based on min and max selected
Mtd =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = eomonth(_max,-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max) )
LMtd =
var _max = eomonth(maxx(allselected('Date'),'Date'[Date]),-1)
var _min = eomonth(_max,-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max) )
or you can use two slicer
Power BI How to use/compare two Date/Period slicers: https://youtu.be/WSeZr_-MiTg
@Roym , If you have date or create date using year and month
Date = Date([Year], [Month], 1)
Join with Date of date table and use time intelligence
then you can have measure like that have diff measure
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])
Or you can measure based on min and max selected
Mtd =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = eomonth(_max,-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max) )
LMtd =
var _max = eomonth(maxx(allselected('Date'),'Date'[Date]),-1)
var _min = eomonth(_max,-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max) )
or you can use two slicer
Power BI How to use/compare two Date/Period slicers: https://youtu.be/WSeZr_-MiTg
Perfect thanks! I was able to figure it out with your explanation.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
96 | |
90 | |
81 | |
69 |
User | Count |
---|---|
157 | |
125 | |
116 | |
111 | |
95 |