The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |