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

WTD, YTD for different measures

Hi,

 

I am trying to create columns for YTD, WTD and transactions that happened yesterday for mulitple different measures in one matrix. How can I do this?

 

Untitled.png

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @JJL1990 ,

 

Based on my research, we can’t put the measure as column in Metrix. If you’d like to calculate YTD and WTD for measures, you could use table rather than Metrix. Also the transaction happened yesterday will be recorded in measure as well using table.

Below steps and attached pbix are for your reference: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/ETiPpoUalpxPhb0fnmsubJ...

  1. I’ve created a table with original data: Date and Volume. And 3 measures :
Leadsoffered = MAX(Table1[Volume])*1
LeadsReferred = IF(MAX([Volume])=BLANK(),BLANK(),MAX([Volume])+2)
Referralrate = LeadsReferred/ Leadsoffered

1.PNG

2. Create a new calendar table with dates from 2018/12/1- 2019/6/30, and manage the relationship between them, aims to use time intelligence function:

2.png

3. Created 2 new columns to show week number:

wn = WEEKNUM([Date1],1)
    yr = YEAR([Date1])

4. You can use the codes following to generate YTD for volume and YTD for Leadoffered(LO YTD):

YTD volume = TOTALYTD(SUM(Table1[Volume]),Table1[Date])

       LO YTD = IF(SUM(Table1[Volume])=BLANK(),BLANK(),CALCULATE(SUMX('Table1',[Leadsoffered]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])),VALUES('Table1'[yr])))



       WTD volume = CALCULATE(SUM(Table1[Volume]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])),VALUES(Table1[wn]))

      LO WTD= IF(SUM(Table1[Volume]) = BLANK(),BLANK(),CALCULATE(SUMX(Table1,[Leadsoffered]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])),VALUES(Table1[wn])))

LF YTD, RR YTD….by that analogy

3.PNG

Best regards,

Dina Ye

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

View solution in original post

1 REPLY 1
v-diye-msft
Community Support
Community Support

Hi @JJL1990 ,

 

Based on my research, we can’t put the measure as column in Metrix. If you’d like to calculate YTD and WTD for measures, you could use table rather than Metrix. Also the transaction happened yesterday will be recorded in measure as well using table.

Below steps and attached pbix are for your reference: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/ETiPpoUalpxPhb0fnmsubJ...

  1. I’ve created a table with original data: Date and Volume. And 3 measures :
Leadsoffered = MAX(Table1[Volume])*1
LeadsReferred = IF(MAX([Volume])=BLANK(),BLANK(),MAX([Volume])+2)
Referralrate = LeadsReferred/ Leadsoffered

1.PNG

2. Create a new calendar table with dates from 2018/12/1- 2019/6/30, and manage the relationship between them, aims to use time intelligence function:

2.png

3. Created 2 new columns to show week number:

wn = WEEKNUM([Date1],1)
    yr = YEAR([Date1])

4. You can use the codes following to generate YTD for volume and YTD for Leadoffered(LO YTD):

YTD volume = TOTALYTD(SUM(Table1[Volume]),Table1[Date])

       LO YTD = IF(SUM(Table1[Volume])=BLANK(),BLANK(),CALCULATE(SUMX('Table1',[Leadsoffered]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])),VALUES('Table1'[yr])))



       WTD volume = CALCULATE(SUM(Table1[Volume]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])),VALUES(Table1[wn]))

      LO WTD= IF(SUM(Table1[Volume]) = BLANK(),BLANK(),CALCULATE(SUMX(Table1,[Leadsoffered]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])),VALUES(Table1[wn])))

LF YTD, RR YTD….by that analogy

3.PNG

Best regards,

Dina Ye

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

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.