Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pstanek
Post Patron
Post Patron

Time Intelligence Functions (DAX)

Can I use

Time Intelligence Functions (DAX)

in Power BI?

8 REPLIES 8
KHorseman
Community Champion
Community Champion

Yes. You can use any DAX functions in Power BI.





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

Proud to be a Super User!




Can you give me a hint ?

pcena_bd_last30days2 = CALCULATE(SUM(movement[pcena]); movement[datum]>NOW()-30; movement[datum] <= NOW())

I tried to rewrite this with function datesbetween, but It did not work.

 

Hi Pstanek,

 

According to your description, you need a moving sum for latest 30 days, right?

 

If that is the case, here is a blog which describes hwo to do it step by step, please refer to the link below to see the details.
[3 Month Moving Sum Units Sold] =
CALCULATE([Units Sold],
          DATESINPERIOD(Calendar[Date],
                        LASTDATE(Calendar[Date]),-3, Month
                       )
         )

http://www.powerpivotpro.com/2013/07/moving-averages-sums-etc/

 

Regards,

Charlie Liao

@pstanek In order to use time intelligence functions you need to have a date table related to your fact table. It would appear in your DAX function that you are referencing the same table.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

 Is it the table with only one column --dates ?

@pstanek Here is a thread which describes how to create a dynamic data table in PBI. It is a table that relates to a date in your fact table, and allows you to filter on other date parts (YR, MO, etc).

http://community.powerbi.com/t5/Desktop/Possible-Tip-Trick-Dynamic-Date-Dimension-Table/td-p/8462

 There are numerous other examples out there.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

It can have as many columns as you like but it needs one column with an unbroken range of dates (i.e. every date within the range with no dates skipped). People frequently add other columns such as Month and Year in order to use those groupings in their visuals, but that depends on your goals with this.





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

Proud to be a Super User!




Sean
Community Champion
Community Champion

@pstanek Try this Measure... let me know

 

pcena_bd_last30days =
CALCULATE (
    SUM ( movement[pcena] ),
    DATESINPERIOD ( movement[date], LASTDATE ( movement[date] ), -30, DAY )
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.