Forum Discussion

KGPBI's avatar
KGPBI
Regular Visitor
7 years ago

Calculate a column with multiple values

From nav i am making a report in Power BI. The nav report i want to recreate has multiplte filters for different columns. 

Salestype A = Column 1: A,B
                Column 2 100,200
                Column 3: "SupportX" or "Support Y"
Salestype B = Column 1: A,C
                       Column 2: 100,300
                       Colum3: "ERP1" or "ERP2"

Now i have created measures and that gives me the right values:

Saletype A = [Total amount]
(FILTER (Ledger entries; Ledger entries [Revenue Distribution] = "VA SUPPORT");
FILTER (General ledger entries; General ledger entries [Cost center Code] = 2,000);
FILTER (General ledger entries; General ledger entries [AggregationTF] = 1) 
Salestype B = Business apps hours = [TotalAmount]
(FILTER (Ledger entries; Ledger entries [AggregationTFBusiness apps] = 1);
FILTER (General ledger entries; General ledger entries [CostPlaceFiltering] = 1);
FILTER (Ledger entries; Ledger entries [RevenueDistributionFiltering] = 1)
)

 But to optimally use PowerBi I would like to create a (calculate)column what says me what salestype it is. In total i have arround 20 salestypes.  What is the best solution for this?



1 Reply

  • Stachu's avatar
    Stachu
    Icon for Community Champion rankCommunity Champion

    Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

    Column1Column2
    A1
    B2.5

    also the code you posted is not proper DAX, can you paste the code as is used in the PowerBI?

     

    One option to solve this could be a dictionary table, other would be to hardocde the logic. if it's supposed to be in the calculated column then M (Power Query) may be a better option, but it's impossible to tell without knowing more about your model