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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |