Forum Discussion

tsimon21's avatar
tsimon21
Regular Visitor
2 years ago
Solved

Powerbi formula Issue

Total Volume / Day - Combined vs Last 4 Days of Week - % = DIVIDE([Total Volume - Combined - Last Date]  - [Total Volume / Day - Combined - Last 4 Days of Week], [Total Volume / Day - Combined - L...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi tsimon21 ,

     

    Create calculated colunm and modify formual like below:

    week = WEEKDAY('Table'[Date],2)
    result_ =
    VAR cur_ =
        CALCULATE (
            SUM ( 'Table'[Total Volume] ),
            DATESBETWEEN ( 'Table'[Date], TODAY (), TODAY () )
        )
    VAR sel_ =
        SELECTEDVALUE ( slicer[Week] )
    VAR week_ =
        WEEKDAY ( TODAY () - sel_, 2 )
    VAR last_sel_week =
        CALCULATE (
            SUM ( 'Table'[Total Volume] ),
            DATESBETWEEN ( 'Table'[Date], TODAY () - sel_, TODAY () - sel_ ),
            FILTER ( 'Table', 'Table'[week] = week_ )
        )
    RETURN
        DIVIDE ( cur_ - last_sel_week, last_sel_week )
    
    

     

     

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.