Forum Discussion
Creating a relationship in Powerbi
Hi, PradipMCT
Thank you for reaching out with your query on creating an efficient data model in Power BI for analyzing training costs and comparing them to allocated budgets. Based on the details you've provided, I have a few suggestions and best practices that could help streamline your analysis.
As PijushRoy said, you can use Power BI built-in time intelligence function TOTALYTD. Use a measure to calculate the Year-To-Date (YTD) expense. DAX formula example:
YTD Training Expense = TOTALYTD(SUM(Training expenses[Training Expenses]), 'Date'[Date])
Total Training Budget:
A simple SUM measure can be used here:
Total Training Budget = SUM(Training Budget[Training Budget])
Percentage of Budget Spent on Training (YTD):
First, calculate the YTD Training Expense and Total Training Budget as mentioned above. Then, use another measure to calculate the percentage:
Percentage Spent = DIVIDE([YTD Training Expense], [Total Training Budget])
You can use your measure in the table visual, add locations to the slicer, and display the corresponding results by selecting different locations. I hope this helps set you on the right path for your analysis.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.