Forum Discussion

LewisB's avatar
LewisB
Frequent Visitor
3 years ago
Solved

Selectedvalue in a Switch measure not selecting dates correctly

Hi team   I have created a calculated column that looks for a particlar company, and then multiplies it net sales by a set amount based on a date range. This column works fine, however I need it to...
  • amitchandak's avatar
    3 years ago

    LewisB , Create a measure like

     

    x-Updated Sales Measure = Sumx('# Sales' , SWITCH(

    True(),

    ('# Sales'[Company Code]) = "pus" && ('# Sales'[Invoice Date]) >= DATE(2023,01,01) && ('# Sales'[Invoice Date]) <= DATE(2023,03,31), SUMX('# Sales', '# Sales'[Net Sales Amount] * 1.4997),

    ('# Sales'[Company Code]) = "pus" && ('# Sales'[Invoice Date]) >= DATE(2022,10,01) && ('# Sales'[Invoice Date]) <= DATE(2022,12,31), SUMX('# Sales', '# Sales'[Net Sales Amount] * 1.5302),

    SUM('# Sales'[Net Sales Amount])

    ))

     

    refer approach

    Measure way
    Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM