Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Removing empty space until the first column with value

Hello, I am trying to create a visual with empty columns in between, but removing any empty space until the first column with value.

I am also slicer to change between projects so the date range needs to be dynamic as it changes by different projects.

For values currently using (the +0 is for not skipping columns):

Payment test = CALCULATE(SUM('Payment'[Payment]),Payment[Type]="Payment" || Payment[Type]="Deposit") + 0
 
And for dates themselves it is every monday of week as cash inflows are assigned to specific week starts to reduce column count.

2 Replies

  • Anonymous , Try if this formula can help, assuming you are using date table

     

    0 between range
    Measure = var _1= CALCULATE(SUM('Payment'[Payment]),Payment[Type]="Payment" || Payment[Type]="Deposit")+0
    var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
    var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
    return
    CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, I tried something similar but it did not work. Tried to do exactly like you but the result is:

      measure powerbi =
      var _1= CALCULATE(SUM('Payment'[Payment]),Payment[Type]="Payment" || Payment[Type]="Deposit")+0
      var _min = minx(ALLSELECTED('Dates'), 'Dates'[Date])
      var _max = maxx(ALLSELECTED('Dates'), 'Dates'[Date])
      return
      CALCULATE(if(max('Dates'[Date]) <_min || max('Dates'[Date]) >_max , BLANK(), _1))

       

      Result visual: