cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
chrispybacon Frequent Visitor
Frequent Visitor

Calculatation within same column according to different attributes

Hi,

 

I need the help of some DAX gurus. 

Currently I am encountering the following problem. We want to calculate the leadtime in production. So we have the different leadtimes( Wait LT, Storage LT, etc.) in one column as attributes, and in the other the according values. It shall be displayed in a waterfall visual. 

The same attribute column holds, the attribute "number of batches". So after a set of leadtime attributes I get one value with the number of batches for my plant and my brand per month. 

Now I tried to for example calculate the average as follows;

AverageLT =
VAR VAL =
    CALCULATE (
        DIVIDE (
            CALCULATE (
                AVERAGE ( 'Table 1'[Value] );
                'Table 1'[Att] <> "number of batches"
            );
            CALCULATE ( AVERAGE ( 'Table 1'[Value] ); 'Table 1'[Att] = "number of batches" )
        )
    )
RETURN
    VAL

However it always returns 0. If I do the same with the average of a column in which I also calculate the number of batches, I get numbers. However the data there is not really consistent, i.e. brands missing etc.. So i want to stick to the current table. 

Did anyone experience similar problems or has an idea why it is not working?

Regards,
Chris

1 REPLY 1
Super User
Super User

Re: Calculatation within same column according to different attributes

Can you provide sample data? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 324 members 3,095 guests
Please welcome our newest community members: