+ Reply to Thread
Results 1 to 6 of 6

DAX month Function division power bi and pivot

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    DAX month Function division power bi and pivot

    Hi,
    using the formula to create the date quarter of the year

    Please Login or Register  to view this content.
    , which I then round up.

    works fine in power pivot data model but when I've tried to use the same in power bi I get a zero? ,

    The

    Please Login or Register  to view this content.
    So, Month 1 = 0 ; 2,3,4 = 1 ; 5,6,7 = 2 ; 8,9 , 10 = 3 ; 11 , 12 = 4 ?

    Can someone explain what is happening ?

    Richard.
    Last edited by Dicken; 08-17-2022 at 09:05 AM. Reason: need to add something.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,620

    Re: DAX month Function division power bi and pivot

    seems you are using integer numbers, not floating point. so the result of dividing by 3 is already rounded down.

    If you don't know how to force using flaoting point, not integer mathematics a simple workaround shall be something like
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX month Function division power bi and pivot

    Thanks, Kaper,
    Good guess I do not know how " force using floating point" , I shall have to look into this, if you have any reading recomendatdions, apart from MS Docs ( not my favorite reference point) please let me know.

    Thank you,

    Richard.

  4. #4
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX month Function division power bi and pivot

    Hi Kaper,

    Just to add I have found that if I dont' use the Month Function,

    just
    Please Login or Register  to view this content.
    ,

    It behaves exactly as I would expect, ( as in excel) , your fix certainly works, but not sure why.



    "
    Please Login or Register  to view this content.

    Richard.

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,620

    Re: DAX month Function division power bi and pivot

    My workaround is based on observation that every first month of the quarter returns previous quarter (in case of Jan it's 0, because there is no quarter before Q1 ) so just by adding 1 to month we are there.

    as for "forcing floating point) - may be
    Please Login or Register  to view this content.
    would do

    This is just a side comment as the thread is already marked SOLVED - Thanks for that, and for reputation point

  6. #6
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: DAX month Function division power bi and pivot

    Thanks for the help, and you're welcome to the mark up.

    RD

+ 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] Large function does not appear in Power Pivot measures
    By viewotst in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-07-2022, 08:41 AM
  2. Replies: 3
    Last Post: 08-10-2020, 11:38 AM
  3. Replace Sumifs Function with Pivot Table in Power Pivot
    By cbrown6305 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-01-2018, 02:53 PM
  4. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  5. How to insert a division function in a pivot table.
    By zazzz in forum Excel General
    Replies: 0
    Last Post: 03-07-2016, 01:34 PM
  6. [SOLVED] RANK.EQ Function in Power Pivot Measure
    By rv02 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-16-2015, 04:26 PM
  7. Replies: 0
    Last Post: 02-04-2015, 11:38 AM

Tags for this Thread

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