Forum Discussion
Jonjon_99
3 years agoHelper I
VAR with multiple return values
hi im new to power BI and would like to learn how to return multiple values based on my matrix column (month, year, quarter, etc.)
i have dax that will return column total but it is only works for month, can anyone help me update this with Year and quarter?
thanks in advance!
%Total Units =
VAR CurrentMonth = MAX('Date'[MonthName])
RETURN
DIVIDE(SUM(SalesFact[Units]),
CALCULATE(SUM(SalesFact[Units]),FILTER(ALLSELECTED(SalesFact),RELATED('Date'[MonthName])=CurrentMonth)))
9 Replies
- Jonjon_99Helper I
hi Alan, thanks for checking. i want to have a table calculated by year.
it works in monthly but not in yearly
- Jonjon_99Helper I
result should be 100% aswell in yearly summary.
- Jonjon_99Helper I
and this is the data.
https://drive.google.com/drive/folders/1i7N8YWWwMvZHEU08rxWIRDBsaC_kz6sg