Forum Discussion

dreyz64's avatar
dreyz64
Icon for Helper III rankHelper III
6 years ago

Tableau Fixed LOD to PBI Issue with Filtering

Hello everyone,

 

I'm struggling with converting this Tableau fixed LOD expression into PBI.

 

Volume Industry = {fixed [Year], [Month], [Market], [Trade Channel], [ProductCategoryGroup]: SUM([Volume])}

 

 

 

So far in PBI I have converted this Tableau measure as follows:

Volume Industry =
CALCULATE(
SUMX('COT', 'COT'[Volume]),
ALLEXCEPT('COT', 'COT'[Date].[Year],'COT'[Date].[Month],'COT'[Date].[Date], 'COT'[Year], 'COT'[Month], 'COT'[Market], 'COT'[Trade Channel],'COT'[Product Category Group])
)

 

 

 

My data is organized in the following way (simplified for this issue):

Date

Market

Trade Channel

Location

Product Group

Product

Volume

2019-01

Japan

Airports

Osaka

Group 1

Product 1.1

10

2019-01

Japan

Airports

Tokyo

Group 1

Product 1.2

5

2019-01

Japan

Ferries

Osaka

Group 1

Product 1.2

4

2019-01

Japan

Airports

Osaka

Group 2

Product 2.1

20

2019-02

Japan

Airports

Osaka

Group 1

Product 1.2

8

2019-02

Japan

Airports

Tokyo

Group 1

Product 1.2

1

2019-02

Japan

Ferries

Osaka

Group 2

Product 2.1

10

2019-02

Japan

Airports

Osaka

Group 1

Product 1.1

5

 
What I would like to have as a behavior is that for any filtering or visual that is at a level higher than Date, Market, Trade Channel, Product group, the Industry volume is basically the sum of volume.
However if we go at a lower level (example location), then the industry level will be equivalent to the industry level at Date, Market, Trade Channel, Product Group (related to the location).
 
I have the following issues: when I have filters on either of the fields in the 'AllExcept' close, the formula works. However, if I am filtering on a lower granularity (example: Osaka), the volume industry is calculated across all markets, TC, Product Groups in my data set (even though Osaka belongs only to Japan).
 
I tried to illustrate my issue below:

 

I feel that I am missing something that allows the formula to take into account context (e.g. if a location selected belongs to a single market, I should have an implicit filter on Market).
 
Thanks a lot for your help!
Cheers
 

6 Replies