Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Datediff with calculate

I have a report for investment in bank products, so I have a tabela with the products and the total investment, how many client ids are investing, and the Stars of these clients (1 Star, 2 stars ...)

I had to create a new collum for showing the M1 investment (when a client opens his account at the bank, how much these clients invested in the first month). Was not a problem

 

Captação Total M1 = 

if(datediff(Planilha1[Data de Abertura Conta];Planilha1[Data de Aplicação];MONTH)<=1;Planilha1[Valor Aplicado]) 
(Translating: Captação Total M1 = Total Funding M1 | Data de Abertura Conta = Opening Acc. Date | Data de Aplicação = Apllication Date | Valor Aplicado = Applied Value)
 
Then I used the value per product and the value as total percentage (red box)

 

Now, I have to divide this total percentage value with the star rating (black box). But, now comes my problem. As I created a new collum, I can't use it for diving because it's not a measure. I don't know how to transform that uper formula for collum into a measure, or use this collum formula in a divide or other formula.

 

I tried to transform the collum into a formula: 

Captação Total M1 por Produto = calculate(sum(Planilha1[Valor Aplicado]);datediff(Planilha1[Data Abertura Conta];Planilha1[Data Aplicação];MONTH)<=1) (no good)
 
And tried use in a divide formula, to calculate the per product/total amount
M1 % Por Produto = divide(CALCULATE(sum(Planilha1[Valor Aplicado]);DATEDIFF(Planilha1[Data Abertura Conta];Planilha1[Data Aplicação];MONTH)<=1);[Total de Captação Total M1]) (no good)
 
And, as I'm going to need to divide the total by product, I have already created a formula with the total ([Total Captação Total M1] = CALCULATE(SUM('Planilha1'[Captação Total M1]);ALLSELECTED(Planilha1)). But now, I need to have the Captação Total M1 por Produto
 
Sem título.png

 

 

 

 
0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.