Forum Discussion

Michael85's avatar
Michael85
Regular Visitor
1 year ago
Solved

Issue with plotting two DAX on a single graphic

Good Morning, I'm fairly new to Power BI, and  trying to do something which appears simple, but for some reason is not working.    I'm using a Sharepoint list to log events, which can be seperat...
  • rajendraongole1's avatar
    1 year ago

    Hi Michael85  -Hope in in your model the tables :  Duty Manager Event Log table is properly related to a dedicated date table in your model. if you dont have date table, please create it .

     

    calculated table FYR:

    DateTable =
    ADDCOLUMNS(
    CALENDAR(DATE(2020, 1, 1), DATE(2030, 12, 31)),
    "Year", YEAR([Date]),
    "Month", FORMAT([Date], "MMM"),
    "MonthNumber", MONTH([Date]),
    "Quarter", "Q" & QUARTER([Date]),
    "Weekday", FORMAT([Date], "dddd")
    )

     

    Modify your measures to include the date context for proper alignment on the line chart.

    MasterCautionCount =
    CALCULATE(
    COUNTROWS('Duty Manager Event Log'),
    'Duty Manager Event Log'[EventType] = "Master Caution"
    )

     

    Another measure for internal events: 

     

    InternalEventCount =
    CALCULATE(
    COUNTROWS('Duty Manager Event Log'),
    'Duty Manager Event Log'[EventType] = "Internal Event"
    )

     

    The original measures did not explicitly include any relationship to the date field, which led to Power BI being unable to group the counts by date when combining both measures. Pleae create it and let us know if still issue exist.