Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

switch selected value not showing value

hello i have this formula: 

 

VB Financial Value = SWITCH(
    SELECTEDVALUE(Sheet1[Line Description item id]),
    "Salesperson" , [Salesperson],
    "Accountant" , [Accountant],
    "HR Cost" , [HR Cost],
    "Attorney Fees",[Attorney Fees],
    "Carrier 1",[Carrier1],
    "Carrier 2",[Carrier 2],
    "Carrier 3",[Carrier 3],
    "Carrier 4",[Carrier 4],
    "Fees",[Fees],
    "Carrier 5",[Carrier 5],
    "Carrier 6",[Carrier 6],
    "Total Expenses",[ total Expenses],
    "Total Minutes",[Minute Cost],
    "Net Profit",'[Net profit],
    "Total Expenses",[total Expenses],
    "Payroll Expenses",[Payroll Expenses])
 
and i got the result here:
 
ExpenseAmount
Payroll Expenses 
        Salesperson8000
        Accountant12908.45
        HR Cost26250
Business Expenses 
        Attorney Fees11250
        Fees88546.5
Minutes Expenses 
        Carrier 124250.61
        Carrier 2116146.87
        Carrier 3409727.58
        Carrier 4256689.8
        Carrier 52660.65
        Carrier 618457.64
Total Minutes 
Taxes 
Total Expenses 
Net Profit 

 

as you can see i have missing value not showing

 

when i put the results in cards, they are shown and correct but in the table they dont show please help

 

NB: payroll expenses is : [salesperson] + [accountant] + [HR Cost]

      business Expenses is : [fees] + [attorney fees] ...

 

so i noticed tha all subsets are being shown the one i used calculate(sum()) formula to get the amount but when i used measures to add totals it doesnt show please help

3 Replies

  • Anonymous .The measure need to changed like

     

    calculate([salesperson] + [accountant] + [HR Cost], all(Sheet1[Line Description item id]))

     

    or

     

    calculate([salesperson] + [accountant] + [HR Cost], allselected(Sheet1[Line Description item id]))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can refer the following links to try to solve your problem...

    Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

    Dax for Power BI: Fixing Incorrect Measure Totals

     

    If the above one can't help you get the desired result, please provide some sample data in the table "Sheet1" (exclude sensitive data) with Text format, the Fields setting of your matrix visual and the formula of involved measuresIt is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

    Best Regards