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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.