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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

How best to organise data query

My database is currently organised as follows:

CountryYearVersionCurrencyP&L lineMonthValue
ABC2018ActualLocal currencyNet SalesJanxx
ABC2018ActualEurNet SalesJanxxx

 

Country: 20 countries

Year: 2018-2022

Version: Actual, Budget

Currency: local, USD (conso)

P&L line: Sales to net profit

Month: Jan - Dec

Value = data

 

I want to create a P&L pivot table using Power Query to show MTD, YTD & Total Year, key ratios (eg. gross margin % sales etc) as well as the comparative variances (eg. actual vs budget vs prior years).  P&L is to be sliceable by country, currency, month.

 

I am unable to create calculated fields for key ratios (field "greyed out"). I also struggle to create DAX formula for MTD, YTD and Total Year.

 

Would greatly appreciate some advice on how to create this in the simplest way.

1 ACCEPTED SOLUTION
ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

You have 1 fact table. In best practice you should separate it by Dimension tables (e.g. PnL Line, Country, Date table etc). This can be achieved in a couple of ways (Power Query or Dax). Then dimension tables will be connected to your fact table, containing repeating values. Then you can create your time-intelligence measures like MTD/YTD based on your Date table and for P&L calculations also you can create measures to dynamically calculate Gross Margin for example (if not already calculated).

If you provide example file I can create a simple model and make some of the calculations, but this file should have the same structure of your original data in order to work




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




View solution in original post

1 REPLY 1
ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

You have 1 fact table. In best practice you should separate it by Dimension tables (e.g. PnL Line, Country, Date table etc). This can be achieved in a couple of ways (Power Query or Dax). Then dimension tables will be connected to your fact table, containing repeating values. Then you can create your time-intelligence measures like MTD/YTD based on your Date table and for P&L calculations also you can create measures to dynamically calculate Gross Margin for example (if not already calculated).

If you provide example file I can create a simple model and make some of the calculations, but this file should have the same structure of your original data in order to work




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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