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 Community:
How can i create a measure that divides (or any calculation) de Units by the Forcast based on when Date 1 and Date 2 Match in a Table?
Thanks , i really appreciate your help and time spent on this inquiry.
Oscar
Solved! Go to Solution.
You can try using TREATAS for this one.
NewMeasure = var units = SUM(Table[Units])
var dates = VALUES(Table[Date 1])
var forecast = CALCULATE(SUM(Table[Forecast]), ALL(Table[Date 1), TREATAS(dates, Table[Date 2]))
return DIVIDE(units, forecast)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You can try using TREATAS for this one.
NewMeasure = var units = SUM(Table[Units])
var dates = VALUES(Table[Date 1])
var forecast = CALCULATE(SUM(Table[Forecast]), ALL(Table[Date 1), TREATAS(dates, Table[Date 2]))
return DIVIDE(units, forecast)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Pat!
Thank you very much for your time and help , this works great! i really appreciate it .
Your solution reflects how an expert you are in Power BI congratulations!!
Thanks Again Pat and congratulations on being such a nice and supportive person and expert user.
Oscar
Hi,
Assuming columns A and B are one dataset and columns C and D are another, we should transform 4 columns into just 3 - Date, Units and Forecast. This can happen by Merging the 2 datasets by the Date column in the Query Editor.
Let me know if this works for you.
Hi Ashish!
That is a good idea , unfortunatelly , i need Date 1 Column "clean" since i am using it for other calculations , by merging both date columns i can compromise the Data, any other thoughts?
I Really appreciate your time and help.
Thanks
Oscar
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 |
---|---|
108 | |
98 | |
81 | |
65 | |
62 |
User | Count |
---|---|
147 | |
116 | |
104 | |
88 | |
65 |