+ Reply to Thread
Results 1 to 5 of 5

Powerpivot DAX formula to build histogram?

  1. #1
    Forum Contributor
    Join Date
    10-05-2005
    Posts
    112

    Question Powerpivot DAX formula to build histogram?

    Hi,

    I'm just rying to build a DAX formula to allow a Histogram to be built but failing horribly and hoping someone might be able to point me right?

    Basically I have a whole bunch of rows of data taken every 5 minutes and I would like to be able to report how much time is spent in each zone, for example how long the values remain between 50 and 60.

    In english this would write something like this where VALUE is the column of 5 minute data, instances of cells which match the critera mutiplied by 12 to give hours:

    Hours Spent At = COUNT(VALUE,VALUE>50 and VALUE<60) * 12

    My best attemp in DAX is this:

    V5060:=COUNTX(RawData,[VALUE]>=50&<60)*12

    This is very wrong but not sure how to correct it?

    Thanks in advance.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Powerpivot DAX formula to build histogram?

    Can you upload sample of your data? Enough rows to demonstrate your need.

  3. #3
    Forum Contributor
    Join Date
    10-05-2005
    Posts
    112

    Re: Powerpivot DAX formula to build histogram?

    Hi CK76,

    I think I worked it out by using the calculate function:

    Time Spent:=(CALCULATE(COUNT([VALUES]),RawData[VALUES]>=50,RawData[VALUES]<60)/12)+0

    The +0 at the end is to force a '0' to return instead of 'BLANK'

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Powerpivot DAX formula to build histogram?

    CALCULATE is very useful to learn.

    You can find detailed breakdown in link below.
    http://sqlblog.com/blogs/marco_russo...ks-in-dax.aspx

  5. #5
    Forum Contributor
    Join Date
    10-05-2005
    Posts
    112

    Re: Powerpivot DAX formula to build histogram?

    Fantastic, thanks for the link.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Allow use of Slicers on PowerPivot to be used by users without PowerPivot
    By weeble33 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-09-2017, 05:19 PM
  2. Replies: 4
    Last Post: 07-23-2015, 03:35 PM
  3. Replies: 2
    Last Post: 06-02-2014, 09:34 AM
  4. Replies: 0
    Last Post: 11-20-2012, 05:34 AM
  5. How do I build a histogram with two bins?
    By flyboy54 in forum Excel General
    Replies: 0
    Last Post: 10-10-2012, 05:44 PM
  6. [SOLVED] I was creating a histogram; now i have data but no histogram.
    By ShannonMills3 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-13-2006, 07:10 PM
  7. [SOLVED] How to Histogram w/o raw data but histogram Table on Excel
    By 2005 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-01-2006, 02:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1