Forum Discussion

sudhanshu45's avatar
sudhanshu45
Frequent Visitor
9 months ago
Solved

Total not showing in table visual

i have sales order number column and discount column. When I create table with both this column , discount column is not summarised I get sales order wise discount. here at bottom total is not enab...
  • v-sshirivolu's avatar
    v-sshirivolu
    9 months ago

    Hi sudhanshu45 ,
    Thanks for sharing the details. The issue is happening because your two columns come from different tables with a many-to-one relationship. In this scenario, a raw column from the one side (Discount) cannot automatically compute row level values and totals correctly in the table visual.

    The recommended approach is to create a DAX measure that handles both row level and total calculations. Here’s a working example I have tried :

    DiscountPerOrder =
    IF(
    HASONEVALUE(SalesOrderTable[SalesOrderNumber]),
    LOOKUPVALUE(
    DiscountTable[DiscountAmount],
    DiscountTable[SalesOrderNumber],
    VALUES(SalesOrderTable[SalesOrderNumber])
    ),
    SUMX(
    SalesOrderTable,
    LOOKUPVALUE(
    DiscountTable[DiscountAmount],
    DiscountTable[SalesOrderNumber],
    SalesOrderTable[SalesOrderNumber]
    )
    )
    )
    This approach ensures proper row-level values and accurate totals even when the columns come from different tables in a many-to-one relationship.


    Please find the attached .pbix file for your reference.