Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Jonjon_99
Helper I
Helper 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 9
AlanP514
Post Patron
Post Patron

Hai @Jonjon_99 
Can you please elaborate your question and what you are trying to achive and the expected output you are looking, if its possible please share pbix file using dummy data

Hi @Jonjon_99 
Thank for sharing , recieved the data, now please explain your expected output in detailed way ,
What you are trying to achive , i am not geeting by reading your previous

Hi Alan, thanks again for your reply.
i have sales type filter, for my units,sales and total percenatage of units and sales by column.
right now, it is working in my first matrix if i want to calculate the pecnetage of column by monthly summary cause i have this DAX which is specific only for monthly summary.

%Total Units =
VAR CurrentMonth = MAX('Date'[MonthName])
RETURN
DIVIDE(SUM(SalesFact[Units]),
                        CALCULATE(SUM(SalesFact[Units]),FILTER(ALLSELECTED(SalesFact),RELATED('Date'[MonthName])=CurrentMonth)))
 

Jonjon_99_1-1692253857013.png

now, i want also this filter to work with my yearly matrix. as you can see, calculation is incorrect because the total is >100%.

Jonjon_99_2-1692254148389.png

hope it is clearer now. sorry that my english is not good. haha! apreciate your time and help!


https://drive.google.com/drive/folders/1i7N8YWWwMvZHEU08rxWIRDBsaC_kz6sg?usp=sharing

 



AlanP514_1-1692257488626.png


Hi @Jonjon_99 ,
Here i am attaching the pbix file and screenshot , please confirm this is what you are looking for 
if this is the solution, appreciate to support and accept as a solution

 

Hi Alan,

thanks for checking. still not correct.

this is the result i am expecting.

Jonjon_99_0-1692257975807.png

 

Hi @Jonjon_99 

AlanP514_0-1692257189167.png


Can you please Check these tables 
Above you can see %total units with months
Down you can see %total units with year and it is not showing above >100 %, please confirm 

 

hi Alan, thanks for checking. i want to have a table calculated by year.

Jonjon_99_0-1692249243158.png

it works in monthly but not in yearly

result should be 100% aswell in yearly summary.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.