The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Dear community,
I want to produce a bar chart in Power BI showing the differences between two years for: sales, average sales, total hours and total training. I want to split it into two categories: Operational (sales and avarage sales) and Training (total hours and total training). Now my bar chart looks like this:
I want it to be interactive, i.e I want to choose two years in the slicer. The differences have been computed by measures:
E.g. the percentage difference for sales:
Solved! Go to Solution.
@emillia1991 , Use a separate Date or Year Table, joined with your table
new measure =
var _max = maxx(allselected(Date),Date[Year])
var _min = minx(allselected(Date),Date[Year])
return
calculate( sum(Table[Value]), filter('Date', 'Table'[Date] =_max )) - calculate( sum(Table[Value]), filter('Date', 'Table'[Date] =_min ))
@emillia1991 , Use a separate Date or Year Table, joined with your table
new measure =
var _max = maxx(allselected(Date),Date[Year])
var _min = minx(allselected(Date),Date[Year])
return
calculate( sum(Table[Value]), filter('Date', 'Table'[Date] =_max )) - calculate( sum(Table[Value]), filter('Date', 'Table'[Date] =_min ))
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |