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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Grouping the data according to the age.

Hi,

I have the data in the following way:

Entry Date          XCategory       YDetail      

1/1/2020               A                  B

2/3/2020               c                   d

ddmmyy                x                    y             and so on.....

 

I have a date selected from the date table = calendar(dates(ddmmyy),today()) - I am able to select the date from slicer.

I have to calculate the Age of each detail by substracting the entry date and selected date and show the data in the following pivoted way:

0-7days               8-14days               15-22 days ...... so on

count(detail)       count(detail)           count(detail) .... so on

 

I have acheived till getting the age, but am unable to filter out the data as shown above.

 

Any help on this??

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

I am afraid you cannot put the days before like the expected result, because it can only be measure if you want it to be dynamic. As the workaround, you can try create 2 following measures. However, the problem is if you want the range range days field you can only input 1 by 1, there is no straight forward feature to generate the range for measures.

 

Day Diff = DATEDIFF(SUM([Entry Date]),SELECTEDVALUE('Date table'[Date]),DAY)

Days = CALCULATE(SWITCH(TRUE(),
[Day Diff]>=0 && [Day Diff]<=7,"0-7 Days",
[Day Diff]>=8 && [Day Diff]<=14,"8-14 Days",
[Day Diff]>=15 && [Day Diff]<=22,"15-22 Days"))

V-pazhen-msft_0-1607920674645.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Anonymous 

I am afraid you cannot put the days before like the expected result, because it can only be measure if you want it to be dynamic. As the workaround, you can try create 2 following measures. However, the problem is if you want the range range days field you can only input 1 by 1, there is no straight forward feature to generate the range for measures.

 

Day Diff = DATEDIFF(SUM([Entry Date]),SELECTEDVALUE('Date table'[Date]),DAY)

Days = CALCULATE(SWITCH(TRUE(),
[Day Diff]>=0 && [Day Diff]<=7,"0-7 Days",
[Day Diff]>=8 && [Day Diff]<=14,"8-14 Days",
[Day Diff]>=15 && [Day Diff]<=22,"15-22 Days"))

V-pazhen-msft_0-1607920674645.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.