Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filtering a line chart

Hi Everyone,   I’m just starting with Power BI and have a problem with a line chart that I hope someone will be able to help with. The chart shows Sales Margin by Employee/Month and is filtered by...
  • tex628's avatar
    4 years ago

    Hi Anonymous ,

    Try this:

    Margin = 
    IF(
    ISBLANK( CALCULATE( [Profit]/SUM('Job Ledger'[Total Price]) , ALLSELECTED('Calendar'[Date])), BLANK(),
    IF(
    ISBLANK( [Profit]/SUM('Job Ledger'[Total Price])),
    0,
    [Profit]/SUM('Job Ledger'[Total Price])))


    Let me know how it goes! 

    Br, 
    J