Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
onkarkulkarni
Creator
Creator

Display Bar chart for current year(2019) always.

Hi all,

I have 2 bar charts,1 showing sales and other showing revenue for different countries.

I have filters year, Product and category. 

I want First Chart (sales) should always display data for 2019 (current year) . It should be filtered by Product only and no impact by Year and Category. 2nd chart should be filtered by all the 3 filters.

I tried with :  Sum({1<[Year]={'2019'},[Year]=,[Category]=>}[Sales])

It is not working as expected. First chart is showing data for Current year but not getting filtered by Product.

Thanks in advance.

Labels (2)
3 Replies
sunny_talwar

Try by removing the 1

Sum({1<[Year]={'2019'},[Year]=,[Category]=>}[Sales])

onkarkulkarni
Creator
Creator
Author

Thanks  @sunny_talwar . I was unwell, so couldn't revert.

One more thing - In above expression, instead of sales, I am trying to use sum (sales) /Sum(revenue).

But it is showing some expression error:

Sum({<[Year]={'2019'},[Year]=,[Category]=>}[sum (sales) /Sum(revenue))

Could you please help to correct.

 

Regards,

OK

 

aslam24196
Contributor III
Contributor III

Hi Kulkarni,

The Expression You have is using a sum function with Set Analysis already so no need of using an nested aggregation. 

Use the Following Expression:

Sum({<[Year]={'2019'},[Year]=,[Category]=>}sales) /Sum({<[Year]={'2019'},[Year]=,[Category]=>}revenue)