dax calculations
RH

Forum home » Delegate support and help forum » Microsoft Power BI training and help » DAX Calculations

DAX Calculations

resolvedResolved · Medium Priority · Version 2016

DAX Calculations

Hi, I have some data which is downloaded daily from our invoice system. We are looking to create a dashboard which will show the date that the invoices should be processed on to check work is being completed within Service Level Agreement. We work across global markets and some of these have different SLA dates to others. For example we have US policy which has a 4 day SLA from the created date and UK policy which has a 5 day SLA from created date. we have all the information from the download other than the SLA date and I am looking to insert a function to calculate the date automatically. All of the data for each policy is stored within the same excel download.

RE: DAX Calculations

Hi Lesley,

Thank you for the forum question.

I would do this with a Switch function in a column calculation.

SLA Date=Switch([Country],"USA",[Date]+4,"UK",[Date]+5,"DE",[Date]+7,............)

You will of course have to replace the names in the square brackets to you column names.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: DAX Calculations

Hi Jens, thank you for your quick reply. I have tried using this formula and it is giving me the following error message "Expressions that yield variant data-type cannot be used to define calculated columns" are you able to assist please. Thank you

RE: DAX Calculations

Hi Lesley,

Your dates are not the data type dates. I guess that your dates are text strings and that's why you get the error. Change the data type in the query editor. If the query editor cannot do it (it may not recognise the data) please copy one of the "dates" and post it here.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: DAX Calculations

Thank you Jens, that has solved the query.

 

Training courses

 

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Power BI tip:

Report and Visualization Shortcuts

Ctrl + Shift + P: Enter or exit Presentation mode.
Ctrl + Shift + V: Toggle between different visualization types.
Ctrl + G: Group selected visuals.
Ctrl + Shift + H: Hide or unhide selected visuals.
Ctrl + Shift + L: Lock or unlock selected visuals.

View all Power BI hints and tips


Server loaded in 0.06 secs.