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
Magliasoft
Frequent Visitor

Create a new table according to criteria

Hello friends, I am a beginner in power bi and would like help depending on the criteria below

 

I have the following table:

Based on the last date I need to bring the cost of the cod 104.007.400.004

Result is 06/12/16 - Cost US$ 0.13

Creating a table with unique records

 

thank you

 

Forum_P1.png

 

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi @Magliasoft,

 

You poasted the same question here yesterday.  Please stick to one thread.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi

With this function found here in the forum I solved part of the problem, I need to bring a table field and do the division
Example: cost / table = Percentage
013 / 0.95 = 13.68%

Thank You

.Tabela = ADDCOLUMNS(
    SUMMARIZE (
        MovimentoEntrada;
        MovimentoEntrada[COD_ITEM];
        "Data Operacao"; MAX ( MovimentoEntrada[DATA_OPERACAO] )
    );
    "CIF"; CALCULATE (
        SELECTEDVALUE ( MovimentoEntrada[CIF] );
        FILTER (
            MovimentoEntrada;
            MovimentoEntrada[DATA_OPERACAO] = [Data_Operacao]
                && MovimentoEntrada[COD_ITEM] = EARLIER ( MovimentoEntrada[COD_ITEM] )
        )
    )
)

Greg_Deckler
Super User
Super User

Not certain I completely understand what you are going for here. You can create a measure like:

 

FinalCost = CALCULATE(MAX(table[COST]),FILTER(table,Date=MAX(Date)))

You can place this measure into a table visualization along with Cod.


@ 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...
Magliasoft
Frequent Visitor

Hello friends, I am a beginner in power bi and would like help depending on the criteria below

 

I have the following table:

Based on the last date I need to bring the cost of the cod 104.007.400.004

Result is 06/12/16 - Cost US$ 0.13

Creating a table with unique records

 

thank you

 

Forum_P1.png

 

Hi,

 

So for each Cod, you'd like to determine the cost as on the last date.  Am i correct?  If yes, then please share the download link of your file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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