Here is a quick tip for analyzing daily data in Power BI. If you have a query or dataset that contains a date, a category, and a value measure for that category and you want to create a static measure that always returns the total value for all categories, here is the DAX expression you would use:
DailyTotalAllCategories = CALCULATE(sum(Query1[value]),ALL(Query1[categoryname]))
You could then use this daily total DAX measure in calculation of the percentage of the total for each category with this formula:
PercentDailyTotal = DIVIDE(SUM(Query1[value]),DailyTotalAllCategories)
If you are only interested in the percent daily total you could bypass the DailyTotalAllCategories measure altogether and your formula would look like this:
PercentDailyTotal = DIVIDE(
SUM(Query1[value]),
CALCULATE(
sum(Query1[value]),
ALL(Query1[category])
)
)
Speaking in generalities can be a little hard to follow. A simple oil and gas implementation of these concepts is after the break. Continue reading “Power BI Tip: Daily Total and Percent of Daily Total DAX Expressions”