Forum Discussion

Wangfl's avatar
Wangfl
Frequent Visitor
4 years ago
Solved

Switch + Selectedvalue return blank

Hello everyone, I'm struggling to solve a problem with a measure.   I am using Switch + Selectedvalue to build a customized P&L report in Power BI, but two of lines "Other COGS" and "Ratio 1 retur...
  • PaulDBrown's avatar
    PaulDBrown
    4 years ago

    If you are performing a division, you are going to need to remove the row filters. Something along the lines of:

     

     

    Ratio =
    VAR _Profit =
        CALCULATE ( [Gross Profit], ALL ( 'P&L Structure' ))
    VAR _NetSales =
        CALCULATE ( [Net Sales], ALL ( 'P&L Structure' ))
    RETURN
        DIVIDE ( _Profit, _NetSales )