Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

Count Measure from 3 Column

Hi good day can someone help me on my measure, i want to count the total Active from Active/Inactive column, Trade Column = FWL used_BASE/INJECTED = BASE RESULT Thank you  
  • jaineshp's avatar
    1 year ago

    Hey AllanBerces,

    Based on your requirement to count records where Active/Inactive = "Active", Trade = "FWL", and used_BASE/INJECTED = "BASE", here is the solution:

    DAX Measure Solution

    Create a new measure with the following DAX formula:

    Count of Active FWL BASE =
    CALCULATE(
    COUNT('YourTableName'[used_BASE/INJECTED]),
    'YourTableName'[Active/Inactive] = "Active",
    'YourTableName'[Trade] = "FWL",
    'YourTableName'[used_BASE/INJECTED] = "BASE"
    )

    Step-by-Step Implementation

    1. Open Power BI Desktop and navigate to your report
    2. Select the table containing your data in the Fields pane
    3. Right-click on the table name and choose "New Measure"
    4. Replace the default formula with the DAX code above
    5. Update the table name - Replace 'YourTableName' with your actual table name
    6. Press Enter to create the measure

    Key Points to Remember

    • CALCULATE function applies filters to modify the context of the COUNT operation
    • Multiple filter conditions are applied using comma separation (AND logic)
    • Exact text matching is used for all three columns - ensure your data doesn't have extra spaces
    • Case sensitivity matters - verify the exact spelling and capitalization in your data

    Alternative Approach Using COUNTROWS

    If you prefer using COUNTROWS instead of COUNT:

    Count of Active FWL BASE =
    COUNTROWS(
    FILTER('YourTableName',
    'YourTableName'[Active/Inactive] = "Active" &&
    'YourTableName'[Trade] = "FWL" &&
    'YourTableName'[used_BASE/INJECTED] = "BASE"
    )
    )

    Verification Steps

    1. Check your result should show 17 as per your expected output
    2. Validate data types ensure all columns are text/string format
    3. Review filter conditions confirm there are no trailing spaces or formatting issues
    4. Test the measure in a card visual or table to verify accuracy

    This measure will dynamically count all rows meeting your three specified criteria and update automatically when filters are applied to your report.

    Fixed? ✓ Mark it • Share it • Help others!


    Best Regards,
    Jainesh Poojara | Power BI Developer

  • swathigouda's avatar
    1 year ago

    Total Active & FWL‑BASE =
    CALCULATE(
    COUNTROWS('YourTableName'),
    'YourTableName'[Active/Inactive] = "Active",
    'YourTableName'[Trade] = "FWL used_BASE/INJECTED = BASE"
    )