Forum Discussion

Ceane's avatar
Ceane
Regular Visitor
9 years ago
Solved

Syntax error in new Measure (SUMX & FILTER)

Hi,  I'm new to PowerBI, but relatively profficient in excel. However no experience with DAX formulas. I am creating a BI dashboard based on some financial data, and I'm trying to create a new measu...
  • v-huizhn-msft's avatar
    9 years ago

    Hi Ceane,

    As the Phil_Seamark, if the data type is text, you should use "EBIT" rather than EBIT. For your requriement of 'Cost Base = Revenue - EBIT', the Revenue is Net Revenue, right? If it is, please create measure using the following formulas.

    Cost Base = sumx(filter('Cost Types','Cost Types'[Cost Type]="Net Revenue"),'Cost Types'[Amount])-sumx(filter('Cost Types','Cost Types'[Cost Type]="EBIT"),'Cost Types'[Amount])
    
    Other Costs = 'Cost Types'[Cost Base]- sumx(filter('Cost Types','Cost Types'[Cost Type]="TEC"),'Cost Types'[Amount])


    Then create three slicer including currency, division and location seperately. Create a  a stacked bar graph, select the date as axis level, the Cost and Other Costs measures are value level, you will get the chart like the following screenshot.




    You can click the Format->Edit Interactions, edit if the slicer effect bar chart. When you hit button highlighted in yellow background, the slicer will effect the chart. Otherwise, the slicer doesn't effect chart when you select the circle(highlighted in red line).



    If you have any other problem, please let me know.

    Best Regards,
    Angelia