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
Anonymous
Not applicable

Date intelligence

Hi,

 

I want to compare my actual result with the past result (1 week difference) to use in a KPI visualization and get the % difference. My measure is the following:

 

Total Clientes = DISTINCTCOUNT('BLABLA'[Codigo_Cliente])
 
I tried to create another measure to get the past result:
 
Total Clientes Anterior = CALCULATE([Total Clientes],DATEADD('BLABLA'[FechaCarga].[Date],-1,MONTH))
 
But it didnt work. How could I get this number?
 
 
 
Thanks in advance,
 
IC
4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Build a Calendar Table and create a relationship from the Date column of your base data Table to the Date column of the Calendar Table.  In the Calendar Table, create a Year and Month column with these calculated column formulas

Year = Year(Calendar[Date])

Month = FORMAT(Calendar[Date],"mmmm")

Create 2 slicer - one each for Year and Month.  Select any one Year and Month.  Now write these measures:

Total Clientes = DISTINCTCOUNT('BLABLA'[Codigo_Cliente])

Total Clientes Anterior = CALCULATE([Total Clientes],PREVIOUSMONTH(Calendar[Date])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

 

Could you go step by step in creating a Date table? I really need it to get one big date filter for everything.

 

I have different datasets with different date keys. One of them only have one date variable, but another one has two dates (product retention: one for start date and another for end date). I wanted to make a main date table that links to all of the datasets.

Hi,

Go to Modelling > New Table and write this formula

Calendar = CALENDAR(MIN(Table1[Date]),MAX(Table1[Date]))

Table1 is that Table which carries the minimum date of all Date column across all your Tables.  For the Table where you have a start and end date, we will need to create a single Date column in the Query Editor.  Thereafter, you can create relationships from the Date column of all Tables to the Date column of the Calendar Table.  I can offer more help, if i get some data to work on and if you can be clear about exactly what you want.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT....

 

Also, check out my Quick Measures that deal with weeks:

https://community.powerbi.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=fals...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.