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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
hasaneyldrm
Frequent Visitor

how to use a compared time filter

I want to see my main values ​like turnover and sales with certain periods (custom) and visualize the difference between them.

 

I'm trying to use a compared time filter, but it resets directly when I change it slightly with values. I don't understand where I went wrong.


What i did:


1-) I created a new table


Previous Date = ALLNOBLANKROW ( 'salesorder'[createdon] )


2-) I created a relationship 

hasaneyldrm_0-1687324583377.png



hasaneyldrm_1-1687324595167.png

 


3-) then i sync my values with Dax

Previous SaleQuantity =
CALCULATE (
    [orderNumberMeasure],
    ALL ( 'salesorder'[createdon] ),
    USERELATIONSHIP ( 'salesorder'[createdon], 'Previous Date'[createdon] )
)

hasaneyldrm_2-1687324615595.png



I can clearly see that the report is working, but when I try to pull data at different times, the data is reset.

hasaneyldrm_3-1687324628943.png

 



1 REPLY 1
some_bih
Super User
Super User

Hi @hasaneyldrm to see any kind of previous values just use time intelligence functions in DAX, like MTD, YTD ...

some of examples on link . Hope this help

https://www.daxpatterns.com/standard-time-related-calculations/





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

Proud to be a Super User!






Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.