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
bhead
Regular Visitor

Period To Card Calculated Card

Hello, 

 

I have been spinning my wheels on this one and it should be easy. 

 

I have 2 tables one data, and one date. The Data table contains a date feild that should match to a date range provided in the date Table, which classifies that date to a week, period, and year. When I select my week, I should be able to automatically return the period the week is in and calculate my total period costs over my total period units. 

 

I have tried this several ways however I am not coming to correct values. 

 

Table Creation:

Finance - Calculated PTD = SUMMARIZE('Data - Finance','Period Chart'[Year],'Period Chart'[Period],'Data - Finance'[Attribute],"PTD Balance",sum('Data - Finance'[Value]))
 
Column Creation:
PTD Values = CALCULATE(SUM('Finance - Calculated PTD'[Value]))/CALCULATE(SUM('Finance - Calculated PTD'[Value]),'Finance - Calculated PTD'[Attribute]="Throughput")
 
I haven't had either of these work as intended.
 
 
Capture.JPG
 
Date Table.JPG

  

 

 
 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@bhead , Assuming you are calling the second one is date table . Create a date table with calendar with all dates. You can have week of you choice . And join Date to date

Example

Week Number = WEEKNUM([Date],2) // Monday week, for other refer by blog

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

Week = if('Date'[Week Number]<10,'Date'[Year]*10 & 'Date'[Week Number],'Date'[Year]&'Date'[Week Number])
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
Week name = [Week Start date] & " to "& [Week End date]
Weekday = WEEKDAY([Date],2)
WeekDay Name = FORMAT([Date],"ddd")

Any Weekday Week

https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

You can group data by week.

Also, refer

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@bhead , Assuming you are calling the second one is date table . Create a date table with calendar with all dates. You can have week of you choice . And join Date to date

Example

Week Number = WEEKNUM([Date],2) // Monday week, for other refer by blog

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

Week = if('Date'[Week Number]<10,'Date'[Year]*10 & 'Date'[Week Number],'Date'[Year]&'Date'[Week Number])
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
Week name = [Week Start date] & " to "& [Week End date]
Weekday = WEEKDAY([Date],2)
WeekDay Name = FORMAT([Date],"ddd")

Any Weekday Week

https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

You can group data by week.

Also, refer

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

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.

Top Solution Authors