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
edvapran
New Member

group data by dimension (aggr function in qlik sense)

Hi, there's no way to say this problem easily..

I have 3 tables:

  • POS current month data table (item, location code, datetime, sales amount)
  • plan table (location code, latitude,longitude, sales plan)
  • location table (location code, latitude,longitude) 

These tables have a relation by location code column: PLAN 1-* POS *-1 LOCATION

Main goal is to show a map chart that displays location code on the map with it's sales plan execution percentage.

 

In Qlik Sense its super easy, there is a aggr function, that automatically groups by any dimmension:

sum([Sales amount]) / sum(aggr(sum([Sales plan]),[Location code]))

 

In powerBI Plan table I have added:

(new column) TotalSales = sumx(relatedtable(POS);POS[Sales amount])

(new measue) Execution = sum(Plan[TotalSales]) / sum(Plan[Sales plan])

 

Abviously now every location shows the same execution percentage, because there is no grouping by location. How to solve this?

 

1 ACCEPTED SOLUTION

Ok, I managed to find a solution, it has to with relationship, [Cross filter direction] has to be set to both directions. Have no idea why isn't this set as default...

 

 

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Generally add Location to your Legend and you will get your grouping.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Does not allow to add this field to Map's Legend.

I have also tried to create a simple chart, same result, all locations show the same execution percentage.

Ok, I managed to find a solution, it has to with relationship, [Cross filter direction] has to be set to both directions. Have no idea why isn't this set as default...

 

 

Bi-directional cross filtering used to be the default but they changed this some time back. Probably had to do with performance and that bi-directional cross filtering is often not necessary. It is more the exception than the rule.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.