Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear communty,
I'm new here and using Power BI since few months.
I wanted to present sales and sales difference in two different points in time. I want to choose points in time in slicer. My problem is that I have empty columns:
I created D_sales by applying measures, so that I can choose two years and it will calculate the percentage difference for these two years. Below the measures I used:
Hiding these empty columns by dragging is not possible because I want to update data and choose different years in the filter. I'm searching the Internet since yesterday. However, I'm not very succesful. I was wondering if it is possible to write sth in the code so that it won't display empty columns.
@emillia1991 , Try like
Diff_sales =
var _max = maxx(allselected(Sheet) ,Sheet1[year])
var _min = Minx(allselected(Sheet) ,Sheet1[year])
return
IF(
HASONEVALUE('Sheet1'[year]),
BLANK (),
CALCUlATE(
SUM(Sheet1[sales]),
FILTER('Sheet1','Sheet1'[year]=_max
))
- CALCULATE(
SUM(Sheet1[sales]),
FILTER('Sheet1','Sheet1'[year]=_min
))
)
Thank you @amitchandak for your reply. Unfortunately it doesn't work. I still see the empty columns 😞
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |