Power BI: convert date into number
I have a date column so to convert it into numbers, there are 2 options:
- Option 1: CONVERT([argument],INTEGER)
- Option 2: [argument] then convert it into “whole number”
I have a week and year columns so to convert the week into numbers:
var calc1=((DATE([argument1],1,1)-WEEKDAY(DATE([argument1],1,1),1))+1)-7 //start on Sunday WEEKDAY(XX,1), to start on Monday WEEKDAY(XX,2) var calc2=calc1+(7*[argument2]) return CONVERT(calc2,INTEGER)
NOTE: for WEEKDAY(XX,number), see below for more information
I have a month column so to convert it into numbers:
YEAR([argument])*12+ROUNDUP(MONTH([argument]),0)
I have a month and quarter columns so to convert the quarter into numbers:
YEAR([argument])*4+ROUNDUP(MONTH([argument])/3,0)
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...






