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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Get currently monthly target sales amount and display in matrix

GoodDay,
I have a list of companies that have a list of target sales per month in a table.

emkumi_0-1624703244345.png

If no selection is done on the date filter, the maximum monthly target sales amount in the dataset should be the default target sales displayed. (Eg Company1 would be 2021-04, 45881)

So when a selection is made from the date filter, it should display the corresponding monthly target sales based on the maximum month in the filter.

 

My DAX function currently selects the current monthly target sales based on the date filtered.

 

m_SelectedCurrentMonthlyTarget =

VAR SelectedSalesTarget = FORMAT(MAX(vw_Company_Sales[ReportPeriodTo].[Date]),"YYYY-MM")

Return

   CALCULATE([m_MonthlyTargetSales],

    FILTER(vw_ActiveMonthlySales, vw_ActiveMonthlySales[ReportingPeriod]= SelectedSalesTarget

       )

   )

 

When the date filter is filtered

 

emkumi_1-1624703244350.png

When no filter is applied.  I need it to default to the month of 2021-04 and amount 45881

emkumi_2-1624703244353.png

Then I want to display the latest monthly target sales together with a list of sales for the previous months for the same Company1

emkumi_3-1624703244354.png

Your assistance and guidence is most highly appreciated. Thank you in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

You need create new measures:

 

2021-04 sales =  

IF(ISFILTERED([your slicer column]), [m_SelectedCurrentMonthlyTarget], 
CALCULATE([m_MonthlyTargetSales], FILTER(vw_ActiveMonthlySales, vw_ActiveMonthlySales[ReportingPeriod]="2021-04")))

 

For the last month and previous of the last month sales, I cannot say anything without seeing your mode. It would be more clear if you can share a sample pbix and the expected output.


For now, it can be something like:

last and last-1 month = CALCULATE(sum([sales]), Filter(allselected(table),[Company name]=Max([Company name]) && Month([Date]) >=Month(Maxx(All(table),[Date]))-1))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

Thank you for your suggestions.

We eventually settled for having the two tables to display monthly sales and then the target sales for each month.

Anonymous
Not applicable

@Anonymous 
Thank you for your suggestions.
So we ended up with 2 tables, one for monthly sales and one for the monthly targets.

Anonymous
Not applicable

@Anonymous 

You need create new measures:

 

2021-04 sales =  

IF(ISFILTERED([your slicer column]), [m_SelectedCurrentMonthlyTarget], 
CALCULATE([m_MonthlyTargetSales], FILTER(vw_ActiveMonthlySales, vw_ActiveMonthlySales[ReportingPeriod]="2021-04")))

 

For the last month and previous of the last month sales, I cannot say anything without seeing your mode. It would be more clear if you can share a sample pbix and the expected output.


For now, it can be something like:

last and last-1 month = CALCULATE(sum([sales]), Filter(allselected(table),[Company name]=Max([Company name]) && Month([Date]) >=Month(Maxx(All(table),[Date]))-1))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors