Forum Discussion

PiyushH1's avatar
PiyushH1
Icon for Helper I rankHelper I
7 years ago
Solved

Change text result in next column

Hi Team,   Can anyone help me for my below question ?   I have one Excel file which i am taking data in Power bi, my question is if i change any text value in perticular one column then  i should...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Great! Glad it worked. Can you mark my answer as solved please?

     

    I think you are usually supposed to start a seperate topic for another question but there are a few ways to go about this.

     

    https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

     

    I have one that is a little more dynamic but you can swap in static dates easily enough:

     

    Basic Calendar = CALENDAR((TODAY()-2190),(TODAY()+730))

     

    From there, I would advise adding a date table to your reports that use time intellegence, it is very useful. My Fiscal Year runs from April 1 to Mar 31 so you might need to change that one.

     

     
    DateTable = 
    VAR _minTableDate = MIN ('Basic Calendar'[Date])
    VAR _maxTableDate = MAX ( 'Basic Calendar'[Date])
    VAR _minDate = IF ( ISBLANK ( _minTableDate ), DATE ( 2018, 1, 1 ), _minTableDate )
    VAR _maxDate = IF ( ISBLANK ( _maxTableDate ), DATE ( 2019, 12, 31 ), _maxTableDate )
    RETURN
    ADDCOLUMNS (
    CALENDAR ( _minDate, _maxDate ),
    "Year", YEAR ([Date]),
    "Fiscal Year", IF(3>= MONTH([Date]),YEAR([Date])-1,YEAR([Date])),
    "Date -1", [Date]-1,
    "Current Year", YEAR(TODAY()),
    "HalfYear", IF ( MONTH ( [Date] ) <= 6, "1st Half", "2nd Half"),
    "MonthNumber", MONTH ( [Date] ),
    "Current Month", MONTH(TODAY()),
    "YearMonthNumber", FORMAT ( [Date], "YYYY.MM" ),
    "YearMonthName", FORMAT ( [Date], "YYYY. mmmm" ),
    "MonthName", FORMAT ( [Date], "mmmm" ),
    "WeekNum", WEEKNUM ( [Date], 2 ),
    "CurrentWeek", WEEKNUM (today(), 2 ),
    "LastDayofCurrentWeek", CALCULATE(MAX('Basic Calendar'[Date]),WEEKNUM('Basic Calendar'[Date], 2 ) =WEEKNUM(TODAY(),2)),
    "DayNum", DAY( [Date] ),
    "DayOfWeekNumber", WEEKDAY ( [Date], 2 ),
    "DayOfWeek", FORMAT ( [Date], "dddd" ),
    "Quarter", "Q" & FORMAT ( [Date], "Q" ),
    "Current Quarter", "Q" & FORMAT(TODAY(), "Q" ),
    "YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ),
    "CurrentYearQuarter", FORMAT ( TODAY(), "YYYY" ) & "/Q" & FORMAT ( TODAY(), "Q" )
    )