Forum Discussion

alfonsoalmada2's avatar
alfonsoalmada2
Frequent Visitor
3 years ago
Solved

Create dynamic graph and table based on a specific date

Hi Power BI guys, Currently, I've been looking for an option to create a graph and a table based on specific date.  The only data we have is a products' groups , products, a budget and a date s...
  • amitchandak's avatar
    3 years ago

    alfonsoalmada2 . Create a parameter and use that for minth you want Create a end date measure

    end Date = eomonth(Max([Lead Date]), [Param measure])

     

    The apply this approch,

    Measure way
    Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM

    You measure would be like

     

    Sumx(filter (Table, Table[Lead Date]<= Max(date[Date]) && [end Date]>= Max(Date[Date])), divide([Budget],[Param measure]) )

     

    You can use  4 in place of Param measure

     

    Create an independent/disconnected date table

     

    Date == Addcolumns(calendar(date(2012,01,01), date(2024,12,31) ), "Month no" , month([date])
    , "Year", year([date])
    , "Month Year", format([date],"mmm-yyyy")
    , "Month year sort", year([date])*100 + month([date])
    , "Qtr Year", format([date],"yyyy-\QQ")
    , "Qtr", quarter([date])
    , "Month",FORMAT([Date],"mmmm")
    , "Month sort", month([DAte])
    , "FY Year", if( Month(([DAte])) <7 , year(([DAte]))-1 ,year(([DAte])))
    , "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
    ,"Day of Year" , datediff(date(year([DAte]),1,1), [Date], day)+1
    , "Month Type", Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
    eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
    Format([Date],"MMM-YYYY") )
    ,"Year Type" , Switch( True(),
    year([Date])= year(Today()),"This Year" ,
    year([Date])= year(Today())-1,"Last Year" ,
    Format([Date],"YYYY")
    )
    )