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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Nouha
Frequent Visitor

a row included in both values of a slicer

Hello, 

 

for a report i need to set a slicer that filters either "Last month" or "last fiscal year" ; using just a date slider won't do it for the use of this report. 

 

the problem is that the "last month" should is included in the "last fiscal year" too; so an if condition doesnt work 

 

this is an example of the data i have

data.PNG

 

thank you in advance for your answers

 

 

 

1 ACCEPTED SOLUTION

@Nouha,

Change the last fiscal year measure to the following:

last fiscal year= CALCULATE(SUM(Table[CA SME]),FILTER(Table,Table[Fiscal year]=YEAR(TODAY())))


Then follow the guide in the blog below to use slicer to show the two different measures.

https://www.fourmoo.com/2017/11/21/power-bi-using-a-slicer-to-show-different-measures/

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

3 REPLIES 3
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Nouha,

What is your expected result based on the above sample table? Which "last month" and "last fiscal year" do you refer to? 

If you want to calculate CA SME value for this month(201802) and this year(2017) in your table, you can create measures.

last fiscal year= CALCULATE(SUM(Table[CA SME]),FILTER(Table,Table[Fiscal year]=YEAR(TODAY())-1))
last Month= CALCULATE(SUM(Table[CA SME]),FILTER(Table,Table[Month]=Table[YearMonth]))


The YearMonth column can be calculated using DAX:YearMonth = YEAR(TODAY())&"0"&(MONTH(TODAY())-1).

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello ;

 

my hoped for result  is :

 

when I select "Last month" on a slicer (from a table where i enter the two rows 'last month' and "last fiscal year" ) it only displays the row 201802

 

and when i select "last fiscal year" it only displays rows that have fiscal year = 2018 

 

this means that the month 201802 should appear in both selections 

 

 

regards 

Nouha 

@Nouha,

Change the last fiscal year measure to the following:

last fiscal year= CALCULATE(SUM(Table[CA SME]),FILTER(Table,Table[Fiscal year]=YEAR(TODAY())))


Then follow the guide in the blog below to use slicer to show the two different measures.

https://www.fourmoo.com/2017/11/21/power-bi-using-a-slicer-to-show-different-measures/

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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