Forum Discussion

RitaHL's avatar
RitaHL
Frequent Visitor
2 years ago
Solved

Show empty category in a table visual

Good morning,    I was trying to get a    Total Number of order = DISTINCTCOUNT('Table 1'[Column A])+sum('Table 2'[column B])   In Table 1, I put a record of the category I want but without va...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, RitaHL 

    Based on your information, I create sample tables:

     

    Then create a new measure and try the following DAX:

    Total Number of Order = 
    VAR _Total =  CALCULATE(
                DISTINCTCOUNT('Table'[Column A]),
                'Table'[Column A] <> BLANK()
            ) + 
            SUMX(
                FILTER('Table 2', NOT(ISBLANK('Table 2'[Column B]))),
                'Table 2'[Column B]
            )
    RETURN
    IF(
        ISBLANK(_Total),
        "No Value",
        _Total
        )
    

    Here is my preview:

     

    How to Get Your Question Answered Quickly

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.