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
Anonymous
Not applicable

Changing measures calculations based on Slicers

Hello Guys,

 

I need to create  a single Power BI page wtih the following requirement:

Three separate tiles that will have similar 'n' measures in all three of them such that when I click on a specifc month and year in a slicer, the first tile will reflect all the 'n' measures with data from that month.

Simultanously. the 2nd tile with the similar 'n' measures' ( from the first tile) will reflect data for the previous month and the third tile will reflect its own similar measures but for the 2 months before the current month (selected in the month/year slicer in the beginning).

 

I hope I was able to explain the requirement but, please do let me know if if I need to anything else for for clarity.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you. This was helpful.

 

I created the measures for Previous month using:

 

Employees Previous Month = CALCULATE([Total Employees],FILTER(EmpData,
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH)) &&
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH))))

 

Employees 2 MonthsBack= CALCULATE([Total Employees],FILTER(EmpData, 
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH)) && 
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH))))

 

where the dCalendar is date table and

dCalendar[DimDateKey] refers to the dates in the date table.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at the following post.

https://community.powerbi.com/t5/Desktop/Split-amp-filter-data-from-one-table-into-multiple-based-on-a/m-p/342042#M153248

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you. This was helpful.

 

I created the measures for Previous month using:

 

Employees Previous Month = CALCULATE([Total Employees],FILTER(EmpData,
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH)) &&
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-1,MONTH))))

 

Employees 2 MonthsBack= CALCULATE([Total Employees],FILTER(EmpData, 
EmpData[SubmittedDateKey].[Date] >= STARTOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH)) && 
EmpData[SubmittedDateKey].[Date] <= ENDOFMONTH(PARALLELPERIOD(dCalendar[DimDateKey],-2,MONTH))))

 

where the dCalendar is date table and

dCalendar[DimDateKey] refers to the dates in the date table.

Anonymous
Not applicable

DataWithSlicers.jpg

If March has been selected, the first tile with 3 measures will show data for March. The 2nd tile with same measures will show data for February and the 3rd tile will show data for January.

 

Please help urgently. 

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.