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
g_f
Regular Visitor

tabella variabile fatturato

Buongiorno a tutti, avrei bisogno di un vostro aiuto. in power BI

Ho una Tabella con gli obiettivi di fatturato di ogni fornitore che ha il nome del fornitore, una colonna di fatturato minimo e una di fatturato massimo e la relativa fee % del premio maturabile come da esempio.

 

dittasales MinSales max%
ditta Rossi        150.000           200.0001,0%
ditta Rossi        200.000           250.0002,5%
ditta Rossi        250.000           300.0002,6%
ditta Rossi        300.000           350.0003,3%
ditta Rossi        350.000        1.035.0004,3%
ditta Bianchi        100.000           140.0001,0%
ditta Bianchi        140.000           216.0002,5%
ditta Bianchi        216.000           245.6392,6%
ditta Bianchi        245.639           436.8943,3%
ditta Bianchi        436.894        1.000.0004,3%
ditta Verdi        210.197           316.7981,0%
ditta Verdi        316.798           416.7982,5%
ditta Verdi        416.798           516.7982,6%
ditta Verdi        516.798           616.7983,3%
ditta Verdi        616.798        1.616.7984,3%

 

su un altra tabella ho il fatturato sviluppato dal fornitore nell anno.

 

ditta Rossi164.000
ditta Bianchi207.000
ditta Verdi314.000

 

Non riesco a trovare una relazionare le due tabelle con una measure che mi permetta in modo dinamico di avere la relativa fee in base al fatturato.

Gentilmente mi potete aiutare , ne sarei grato.

Grazie

Gianluca 

 

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @g_f 

you can create a 1 to many relationship between Table2 Nd Table1 then you can use the following measure 

%Measure =
VAR CurrentSales =
SELECTEDVALUE ( Table2[Sales] )
RETURN
MAXX (
FILTER (
Table1,
Table1[sales min] <= CurrentSales
&& Table1[sales max] >= CurrentSales
),
Table1[%]
)

View solution in original post

2 REPLIES 2
g_f
Regular Visitor

carissimo grazie tanto..

la strada è lunga ma mi hai tracciato la via !!!

GRAZIE!

tamerj1
Super User
Super User

Hi @g_f 

you can create a 1 to many relationship between Table2 Nd Table1 then you can use the following measure 

%Measure =
VAR CurrentSales =
SELECTEDVALUE ( Table2[Sales] )
RETURN
MAXX (
FILTER (
Table1,
Table1[sales min] <= CurrentSales
&& Table1[sales max] >= CurrentSales
),
Table1[%]
)

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.

Top Solution Authors