I have a Power BI Desktop file with 2 tables in it, Exception_Report (my primary fact table) and BusinessCalendar (which is my designated Date Table where the field RealDate is the unique date column). The two are related with a 1 to Many relationship where BusinessCalendar[RealDate] = Exception_Report[GL Date]. I am attempting to get a distinct count of the Exception_Report[Batch Number] field based on 2 criteria. First, I only want to count batches with a GL date in the previous calendar month. Second, I only want to count batches where the field Exception_Report[Status] is not null.
I can get DAX to work fine with either one of the 2 criteria, but I'm struggling to include both of them. I'm hoping that someone is able to help me combine the 2 measures (specifically the filtering portion) in order to return the correct result that accounts for both filters simultaneously. Thank you in advance!
I can get DAX to work fine with either one of the 2 criteria, but I'm struggling to include both of them. I'm hoping that someone is able to help me combine the 2 measures (specifically the filtering portion) in order to return the correct result that accounts for both filters simultaneously. Thank you in advance!
Excel Formula:
BatchCount =
CALCULATE(
DISTINCTCOUNT(Exception_Report[Batch Number]),
DATESBETWEEN(
'BusinessCalendar'[RealDate],
EOMONTH(TODAY(), -2) + 1,
EOMONTH(TODAY(), -1)
)
)
Excel Formula:
BatchCount =
CALCULATE(
DISTINCTCOUNT(Exception_Report[Batch Number]),
FILTER(
'Exception_Report',
'Exception_Report'[Status] <> BLANK()
)
)