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
AndradeRobson
Helper II
Helper II

Could you help me with the DAX function

Dear all, good evening!

I need help.

I have a table called:
2000_Razao_Centro_Custo_Empresa_A

Columns
- Cost Center
- Date
- R$ Movement

Goal:

AndradeRobson_0-1696628570655.png

 

In other words, the value of each expense cost center must represent how much of the Total Revenue it consumes.

But when I try to do this the result is this below.

 

AndradeRobson_1-1696628744934.png

The dax function I created was this:

 

AndradeRobson_2-1696628908627.png

 

 

 

 


Can you help me.

Att.

Robson

1 ACCEPTED SOLUTION

Hi,

Does this measure work?

Measure 2 = if(max('Data Base'[Centro de Custo])="1 - Receitas Liquídas com Vendas",1,DIVIDE([M],[Measure]))

 


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

View solution in original post

11 REPLIES 11
lucadelicio
Super User
Super User

Hi,

 

can you share an excel data example file to help you?

Thank you!

Luca D'Elicio

Luca, good afternoon!

Thanks for the feedback.

Below is an example of the Excel database.

There will be two spreadsheets in the file:
1st Spreadsheet: Example database
2nd Spreadsheet: PivotTable with the objective to be achieved in Power BI

Thanks.

I didn't find a place to insert a spreadsheet. Could you send me your email to send the model file.

Att.

Robson

Upload the pbix on https://wetransfer.com/
Thank you!

Luca D'Elicio

Hi,

upload the pbix i will help you!

Thank you,


Luca D'Elicio

 

Lucas, good night!

Below is the pbix file.

Thanks.

https://we.tl/t-OjQ1C0640J

Hi Andrade,

in the pbix 1 - Receitas Liquídas com Vendas is 5.966 and not 2.500 like you post.
Another question can you specify exactly the operation you do to find the 100% for the first row and the 15% for the second row?
So i will help you!
Thank you,

Luca D'Elicio

Lucas, good morning!

The first post was an example.

Please consider the pbix file and the new excel in the link below with the database, details and summary in the spreadsheets.

Below is a demonstration in Excel of the objective to be achieved in Power BI:

 

https://we.tl/t-XmkMbEsbU9

 

AndradeRobson_1-1696772095125.png

 

AndradeRobson_0-1696770775259.png

 

Sorry for the English, I use Google Translate.

Att.

Robson

Hi,

These measure work

M = SUM('Data Base'[Movimento])
Measure = CALCULATE([M],'Data Base'[Centro de Custo]="1 - Receitas Liquídas com Vendas",all('Data Base'[Conta Contábil + Descrição]))
Measure 2 = if(max('Data Base'[Centro de Custo])="1 - Receitas Liquídas com Vendas",BLANK(),DIVIDE([M],[Measure]))

Ashish_Mathur_0-1696807478398.png

 


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

Ashish, good night!

Just one detail, how can I leave this field at 100%?

 

AndradeRobson_0-1696814016168.png

 

 

The rest worked perfectly.

Thank you very much.

Att. Robson

Hi,

Does this measure work?

Measure 2 = if(max('Data Base'[Centro de Custo])="1 - Receitas Liquídas com Vendas",1,DIVIDE([M],[Measure]))

 


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.