cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper III

## DAX function

I have append table of 2022 and 2023 years from week 25 to week 31 and had column of Tour request number a as appended table ,but I want to show only week 31 data of 2023 and same period in last year of 2022 by sales offices and Y axis should contain no of tour request number in clustered column chart in power bi. what should I do to prepare clustered column chart.

Which DAX function Should I use to do this. The below chart is from EXCEl..I want do same in power bi desktop

Plese Hep me

4 REPLIES 4
Helper II

Make sure you have separate date/week table with Year, Week , YearWeek (YYYYWW)

Have column like this in Date/week Table

Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense)  //YYYYWW format

These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

Last Year  Same Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Week]  = Max('Date'[Week])))

With date table you can also use

week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))

Power BI — WTD Questions— Time Intelligence 4–5

In this blog, we will try to answer, 10 Most Frequently Asked Questions on Week Till Date(WTD) in Power BI.

Helper III

No its not working ,

I have append table of 2022 and 2023 years week wise ,but I want to show only week 31 data of 2023 and same period in last year of 2022 by sales offices should be on X axis and Y axis should contain no of tour request number and Legend field should contain year column in clustered column chart in power bi without filtering data. what should I do to prepare clustered column chart. which  DAX function shoud I use

Helper II

Make sure you have separate date/week table with Year, Week , YearWeek (YYYYWW)

Have column like this in Date/week Table

Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense)  //YYYYWW format

These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

Last Year  Same Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Week]  = Max('Date'[Week])))

With date table you can also use

week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))

Helper II

SameperiodLast Year = CALCULATE(Sum[Sales], DATEADD('Date', -1, YEAR)

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors