DAX Expression logic | SSAS Tabular model

Santosh Kumar 61 Reputation points
2022-08-14T18:53:18.317+00:00

Hi Team,

In our project , we were using SSAS tabular model where we have 2 objects.
1> Dim Employee
2> Fact Employee Utilisation Details

We have only 1 matching record based on the emp_sk key column.
we need to calculate an additional measure called Billable Utilisation based on the below logic.
DAX expression used:
Billable Utilisation :=
IF([Daily Hours]-[Holiday Hours] <=0,0,
DIVIDE([Billable Hours],[Daily Hours]-[Holiday Hours],0))

231055-image.png

The functionality is working fine as expected and getting only 1 record when we dont browse Billable Utilisation measure
but getting all the records when we try to browse Billable Utilisation measure.
Can you please help me, if any change need to be done for my DAx expression.

Thanks in advance
Santosh S

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,344 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alexei Stoyanovsky 3,416 Reputation points
    2022-08-15T06:49:37.53+00:00

    Replace the zero with blank in the first branch of the IF, and just drop it from the DIVIDE.. Zero is a meaningful value for the engine and is thus shown, while rows with all blank values are normally suppressed.


  2. Joyzhao-MSFT 15,631 Reputation points
    2022-08-16T08:05:08.403+00:00

    Hi @Santosh Kumar
    Try:

    Billable Utilisation :=  
    IF([Daily Hours]-[Holiday Hours] <0,BLANK (),  
    DIVIDE([Billable Hours],[Daily Hours]-[Holiday Hours],BLANK ()))  
    

    For measures, it's usually a better design that they return BLANK. Returning BLANK is better because report visuals—by default—eliminate groupings when summarizations are BLANK. It allows the visual to focus attention on groups where data exists.

    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.