cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Narender Member
Member

Calculate current month amount if no selection on month list box

Hi All,

 

I have a requirement , I want to calculate current month amount of current year.But when i will select other month(not current month) from List Box filter then report should show that month amount.

 

So I want a variable base amount . bydefault report will show current month amount but when some other month select than other month amount should show in report.

 

 

Thanks

 

Narender

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calculate current month amount if no selection on month list box

Hi @Narender,

 

Here I made an sample for your reference.

 

Measure = IF(ISFILTERED(Table1[Month]),CALCULATE(SUM(Table1[sales])),CALCULATE(SUM(Table1[sales]),FILTER(Table1,MONTH(Table1[Date])= MONTH(TODAY()) && YEAR(Table1[Date])=YEAR(TODAY()))))

Capture.PNG

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/knnly3yhl4d1as6/Calculate%20current%20month%20amount%20if%20no%20selection...

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

6 REPLIES 6
Highlighted
bidevsugmen Regular Visitor
Regular Visitor

Re: Calculate current month amount if no selection on month list box

Hi @Narender

 

Could you try using this measure?

Assuming, you have a date table named Date..

 

Sum = IF (ISFILTERED ( 'Date'[Month] ),

CALCULATE(SUM(Table[Column])),

CALCULATE (SUM(Table[Column]), Date[Month] = MONTH(TODAY()) && Date[Year] = YEAR(TODAY()))

 

Let me know if this works or not.

 

Thanks,

Suguna.

Community Support Team
Community Support Team

Re: Calculate current month amount if no selection on month list box

Hi @Narender,

 

Here I made an sample for your reference.

 

Measure = IF(ISFILTERED(Table1[Month]),CALCULATE(SUM(Table1[sales])),CALCULATE(SUM(Table1[sales]),FILTER(Table1,MONTH(Table1[Date])= MONTH(TODAY()) && YEAR(Table1[Date])=YEAR(TODAY()))))

Capture.PNG

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/knnly3yhl4d1as6/Calculate%20current%20month%20amount%20if%20no%20selection...

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Community Support Team
Community Support Team

Re: Calculate current month amount if no selection on month list box

Hi @Narender,

 

Does that make sense? If so, kindly mark my answer as a solution to close the case.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Narender Member
Member

Re: Calculate current month amount if no selection on month list box

Hi Frank,

Thank you. It is workig for me.

Can you please tell me 1 more thing ?

how can I apply the same with Quarter. "Calculate current Quarter amount if no selection on month list box".

 

 

Thanks,

 

 

Narender

 

 

 

Community Support Team
Community Support Team

Re: Calculate current month amount if no selection on month list box

Hi @Narender,

 

Please try to use the formula.

 

Measure2 = IF(ISFILTERED(Table1[Month]),CALCULATE(SUM(Table1[sales])),CALCULATE(SUM(Table1[sales]),FILTER(Table1,FORMAT(Table1[Date],"q")= FORMAT(TODAY(),"q") && YEAR(Table1[Date])=YEAR(TODAY()))))

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Narender Member
Member

Re: Calculate current month amount if no selection on month list box

Hi Frank,

 

I am using below measure for quarter.But it is not showing right data.

 

Measure 5 = if(ISFILTERED(Dates[Month]),CALCULATE(COUNT(DOCUMENT[DOC_NO]),DOCUMENT[Flag_Doc]="A"),CALCULATE(COUNT(DOCUMENT[DOC_NO]),DOCUMENT[Flag_Doc]="A",FILTER(Dates,FORMAT(Dates[Date],"q")= FORMAT(TODAY(),"q") && Dates[Year]=YEAR(TODAY()))))

 

 

Thanks,

Narender

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors