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
sfn
Frequent Visitor

Normalizing Periods from Dates

Hi,

 

Does anyone have experience with normalizing date ranges to represent periods starting at n for a set of categories?

 

I have a lot of data on hours spent to execute specific projects, and I would like to compare their evolution over time starting at the same period n - rather than their respective start dates in order to generate a comparable profile.

 

Cheers,

Stian

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

so you basically want to rank the dates for each category
try this calculated column

Column = 
VAR Cat = Table[Category]
RETURN
RANKX(FILTER(Table,Table[Category]=Cat),FIRSTDATE(Table[Date]),,ASC)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

8 REPLIES 8
v-yuezhe-msft
Employee
Employee

@sfn,

You can create date slicer and select specific date value in the slicer to filter your visuals. Or you can create measures if necessary.

Please share sample data of your table and post expected result here so that we can provide you proper methods.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yuezhe-msft,


Thank you for your response, Lydia!

 

Example data below and graphs showing original representation per month and how I would like to represent it aligned at Start or aligned at Start and End points. 

 

CategoryDateQuantity
Category 101.01.20155
Category 101.02.20157
Category 101.03.201512
Category 101.04.20158
Category 201.02.20153
Category 201.03.20155
Category 201.04.20158
Category 201.05.201512
Category 201.06.201514
Category 201.07.20157
Category 301.03.20154
Category 301.04.20152
Category 301.05.20152
Category 301.06.20158
Category 401.05.20153
Category 401.06.20152
Category 401.07.20157
Category 401.08.20159
Category 401.09.20153
Category 401.10.20153
Category 401.11.20158
Category 501.06.20157
Category 501.07.20156
Category 501.08.20157
Category 501.09.20157

 

example.png

 

 

Any known means to achieve something like this?  

 

Best regards,

Stian

@sfn,

Create a measure using DAX below and create a Line chart as shown in the following screenshot.

Measure = SUM(Table1[Quantity])+0

0.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia,

 

I've attempted this and it doesn't yield the result I'd like as it seems to fill the line-points without values as 0 values.

 

I'd like to use a measure that could;

take a specific category's first month and label it as 1, 

take a specific category's second month and label it as 2 etc.

 

Then display these labels as the x-axis.

 

Best regards,

Stian

Stachu
Community Champion
Community Champion

so you basically want to rank the dates for each category
try this calculated column

Column = 
VAR Cat = Table[Category]
RETURN
RANKX(FILTER(Table,Table[Category]=Cat),FIRSTDATE(Table[Date]),,ASC)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Super helpful, i had a similar issue.  Thanks for sharing!!

Anonymous
Not applicable

I getting the following error: 

 

A single value for column 'WELL' in table 'BODS' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Here is my code

 

Column =
VAR Cat = BODS[WELL]
RETURN
RANKX(FILTER(BODS,BODS[WELL]=Cat),FIRSTDATE(BODS[REPORT_DATE]),,ASC)

 

I'm terrible at DAX 😞

sfn
Frequent Visitor

Yes, this resulted in what I was looking for - thanks!

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.