Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Guys,
I am a new user from BI and I have a problem to find max value from a Measure.
I have 2 Tables,
(Clients - This table contains all infomations about our client including CITY, STATE, Lat/Long, Status[This column tell me if the client is ATIVE or NOT])
(Sales - This table contains al the informations about our sales, including the ClientId, each row is a sale)
I put all my clients in a Map using the coordinates. I need to put in this map (descriptions) the number maximo of sales by each State.
Like this.
First I creat a Measure using countrows to find the number of sales by Client.
Table Sales
CODCLI | PRODUCT
1 | A
2 | A
1 | A
3 | A
1 | A
2 | A
Table Clients
CODCLI | STATE | CITY
1 | MG | Patos de Minas
2 | MG | Belo Horizonte
3 | SP | São Paulo
Idependent of filter using in the map, at discription of Client 1 have to appear the MAX VALUE SALES BY STATE = 3.
At discription of Client 2: MAX VALUE SALES BY STATE = 3
At discription of Client 3: MAX VALUE SALES BY STATE = 1
I am using DIRECTQUERY, so I try get this using
Max Value = CALCULATE(MAXX(SUMMARIZE(ALL(Clientes); Clientes[CIDBairro];"contagem"; MAXX(Clientes;[Chips Vendidos Ultimos 60 dias])); [contagem]))
But its justing fiding the value maximo of sales of all clients. So in this example that i show, is like 3 for every client!
Please I need a direction!! haha
Thanks!
Solved! Go to Solution.
Hey @v-qiuyu-msft
I could solve my problem haha I used another way
I used this
VAR CidBairroCurrent = IF(HASONEVALUE(Clientes[codigo_cli]); FIRSTNONBLANK(Clientes[Cidade]; TRUE())) VAR MaximoDaReg = MAXX(FILTER(ALL(Clientes); Clientes[Cidade]=CidBairroCurrent); [Chips Comprados Ultimos 60 dias]) var t = RANKX(FILTER(ALL(Clientes); Clientes[Cidade]=CidBairroCurrent); [Chips Comprados Ultimos 60 dias]) return MaximoDaReg
Table Sales
CODCLI | PRODUCT
1 | A
2 | A
1 | A
3 | A
1 | A
2 | A
Table Clients
CODCLI | STATE | CITY1 | MG | Patos de Minas
2 | MG | Belo Horizonte
3 | SP | São Paulo
Idependent of filter using in the map, at discription of Client 1 have to appear the MAX VALUE SALES BY STATE = 3.
At discription of Client 2: MAX VALUE SALES BY STATE = 3
At discription of Client 3: MAX VALUE SALES BY STATE = 1
Hi @MarceloMasson7,
From the table structure you posted, I can't understand how you calculate the MAX VALUE SALES BY STATE. Can you share some dummy data and corresponding results for us to test?
Best Regards,
Qiuyun Yu
Hey @v-qiuyu-msft
I could solve my problem haha I used another way
I used this
VAR CidBairroCurrent = IF(HASONEVALUE(Clientes[codigo_cli]); FIRSTNONBLANK(Clientes[Cidade]; TRUE())) VAR MaximoDaReg = MAXX(FILTER(ALL(Clientes); Clientes[Cidade]=CidBairroCurrent); [Chips Comprados Ultimos 60 dias]) var t = RANKX(FILTER(ALL(Clientes); Clientes[Cidade]=CidBairroCurrent); [Chips Comprados Ultimos 60 dias]) return MaximoDaReg
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |