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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DSwezey
Helper III
Helper III

Table with Column and Row identifiers

I have a table "Monthly Sales" that has the Sales Reps in rows and Months as Columns.

 

DSwezey_0-1636659423576.png

 

I need to calculate the current selected month sales amount per sales rep based on this data. The issue I am faced with is how do I tell Power Query that the columns are dates so I can write a measure to look for current selected month.

 

EX: If I selected a date of 10/20/2021 I would want to see the October amount for Nick and Hatcher.

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

Hi @DSwezey ,

 

1.As @AlexisOlson  suggested, please click the Name column --> Select Unpivot other columns:

Eyelyn9_0-1637048829796.png

2. Create a date table, build relationships based on Month column.  (I have renamed the Attribute column to Month)

ForSlicer = ADDCOLUMNS( CALENDAR(DATE(2021,1,1),DATE(2021,12,31)),"Month", FORMAT([Date],"mmmm"))

Eyelyn9_1-1637049440242.png

Output:

Eyelyn9_2-1637049461010.png

 

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @DSwezey ,

 

1.As @AlexisOlson  suggested, please click the Name column --> Select Unpivot other columns:

Eyelyn9_0-1637048829796.png

2. Create a date table, build relationships based on Month column.  (I have renamed the Attribute column to Month)

ForSlicer = ADDCOLUMNS( CALENDAR(DATE(2021,1,1),DATE(2021,12,31)),"Month", FORMAT([Date],"mmmm"))

Eyelyn9_1-1637049440242.png

Output:

Eyelyn9_2-1637049461010.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlexisOlson
Super User
Super User

Unpivot the month columns to make the data easier to work with.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors