Forum Discussion
Issue with plotting two DAX on a single graphic
- 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.
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.
Thank you rajendraongole1
It appears it was an issue with the Date Field.
I was able to resolve it.
Thanks again