margin
2 TopicsSimple Cost Ratio from GL Data
Hello all, pretty frustrated with what I feel should be a simple task I have a simple set of GL data, as seen below, where my amount is in one column, and my accounts are rows. I then do a very simple model where I have a GL Account class lookup table, which assigns the class "revenue" and "cost" to each account. I then just want to have a simple cost ratio at the account level, of cost/total revenue. the table should look as such below, but nothing returns at the account level for a margin. even the revenue accounts are wrong, as Revenue Reg should be 60% of total revenue, , and Revenue Spec should be 40% My measures are Value = SUM(data_table[Amount]) Total Revenue = CALCULATE([Value],gl_class[Class]="Revenue") Cost Margin = DIVIDE([Value],[Total Revenue]) any help would be greatly appreciatedSolved854Views0likes2CommentsCalculate Median and Change over Time
Hi everyone, I am hoping someone can help me with this. I am trying to calculate the median of margins for a particular subgroup, and compare it to the median of margins in the previous year, to create a "margin change" variable. I have the following columns: - Company - Region - Margin - Year (2016, 2017, 2018 and 'current') I want to compare the margin change per region. I am not able to use the PREVIOUSYEAR formulas because the Year column is in text format. I have tried the following calculation in DAX: var lastyear = CALCULATE(MAX('Table'[Year]);FILTER(ALLEXCEPT('Table';'Table'[Company]);'Table'[Year]<MAX('Table'[Year]))) Var valuelastyear = CALCULATE(MEDIAN('Table'[Margin]); FILTER( ALL('Table');'Table'[Year]=lastyear)) RETURN CALCULATE(MEDIAN('Table'[Margin])-valuelastyear) I really hope someone can help me! Here's a link to the sample data: https://drive.google.com/open?id=1IUdr_oFW8Y0ZaMVBSgIz7YcM3SZNUGfZSolved4.4KViews0likes8Comments