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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
NickProp28
Post Partisan
Post Partisan

Data only show first of the week

Dear Community,

 

My Income and Profit data are retrieve from DB while Target is manually key in to excel then import to report.

I would like to calculate every week and get their achievement based on monthly target. But the target value only show once on every first week of the month.

NickProp28_0-1603774916818.png

Expected outcome:
January     Income      Target        Achievement
1             10428.64     43988.00       23.71%
2             2897.48       43988.00       0.065%
3             4343.37       43988.00       0.098%
4             8034.64       43988.00       0.18%
5             3866.39       43988.00       0.087%


Attached with pbix: https://ufile.io/gekx3a4z
Appreciate for any help and advice.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@NickProp28 

you can try to create a measure

Measure = 
var _year=SELECTEDVALUE('Calendar'[Year])
VAR _month=SELECTEDVALUE('Calendar'[Month])
VAR _target=CALCULATE(sum(REV_Target[Value]),FILTER(ALL('Calendar'),'Calendar'[Year]=_year&&'Calendar'[Month]=_month&&'Calendar'[weekinmonth]=1))
return if(ISFILTERED('Calendar'[Year])&&ISFILTERED('Calendar'[Month]),_target,sum(REV_Target[Value]))

 1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@NickProp28 

you can try to create a measure

Measure = 
var _year=SELECTEDVALUE('Calendar'[Year])
VAR _month=SELECTEDVALUE('Calendar'[Month])
VAR _target=CALCULATE(sum(REV_Target[Value]),FILTER(ALL('Calendar'),'Calendar'[Year]=_year&&'Calendar'[Month]=_month&&'Calendar'[weekinmonth]=1))
return if(ISFILTERED('Calendar'[Year])&&ISFILTERED('Calendar'[Month]),_target,sum(REV_Target[Value]))

 1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@NickProp28 , Try a measure like

target measure = calculate(firstnonblankvalue(Table[week], sum(Table[target])), filter(allselected(Table),Table[Month] =max(Table[Month]) && Table[year] =max(Table[year])))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Dear @amitchandak @ryan_mayu ,

 

Appreciate your help!
Would like to request some help, how do I accumulate the income for only that month.

NickProp28_0-1603780644046.png

For January is correct. But I dont want keep on adding to the next month.
Would like to reset the accumulate when there's a new month.

Thanks.

@NickProp28 

you can try this

Measure 2 = 
var _year=SELECTEDVALUE('Calendar'[Year])
VAR _month=SELECTEDVALUE('Calendar'[Month])
VAR _week=SELECTEDVALUE('Calendar'[weekinmonth])
VAR income=CALCULATE(sum('Tikcet PL'[Income]),FILTER(ALL('Calendar'),'Calendar'[Year]=_year&&'Calendar'[Month]=_month&&'Calendar'[weekinmonth]<=_week))
return if(ISFILTERED('Calendar'[weekinmonth]),income,sum('Tikcet PL'[Income]))

2.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

December 2024

A Year in Review - December 2024

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