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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
dhanurjaya
Frequent Visitor

DAX Required for New Dealer Count and Value for respective period

Dear All,

 

Please help me for write DAX for logic below....

 

Data availeble in system from FY 2023-24 (Month wise), FY 2024-25 (month wise) and FY 2025-26 ( month wise).

My finacial year is Apr to Mar.

 

1. DAX Logic for New Dealer:

    a. FTM New Dealer: Dealers Last Full Year Value is <=0 and Current Year value is >0. ( it should dynamic if i select Month Apr      then result show only for Apr. if i select May then result show only for May (excluding Apr).

 

b.YTD New Dealer: Dealers Last Full Year Value is <=0 and CY YTD value is >0.

 

Example New Dealer Summary:

 

LY FTM ND Count: ?

LY FTM ND Value: ?

CY FTM ND Count: ?

CY FTM ND Value: ?

 

LY YTD ND Count: ?

LY YTD ND Value: ?

CY YTD ND Count: ?

CY YTD ND Value: ?

 

 

2. DAX Required for Dropped Dealer:

Logic:

Dropped Dealer Cound : Dealers CY Value <=0 and sameperiod LY value >0. (for both FTM/YTD - dynamic)

 

Example Dropped Dealer Summary:

 

LY FTM Drop dealer Count: ?

LY FTM Drop dealer Value: ?

CY FTM Drop dealer Count: ?

CY FTM Drop dealer Value: ?

 

LY YTD Drop dealer Count: ?

LY YTD Drop dealer Value: ?

CY YTD Drop dealer Count: ?

CY YTD Drop dealer Value: ?

 

 

Best Regards,

Dhanurjaya

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Hi dhanurjaya,

Thank you for your patience.

To address your query: Does the formula CALCULATE(SUM('Sales'[SalesAmount]), 'Calendar'[FiscalYear] = LY) < = 0 return the full-year sales for the last year (LY) or only for the selected month?
This formula returns the full-year sales for the last year, as it is filtered solely by FiscalYear and not by month.

We would like to kindly check whether your query has been resolved. If you have found a solution, we request you to share it with the community to assist others who may be encountering a similar issue.

If the issue persists, please provide sample data that clearly illustrates your problem in a usable format (not as a screenshot). Kindly ensure that no sensitive or unrelated information is included. Additionally, please indicate the expected outcome based on the provided sample data.

If you found our response helpful, we would be grateful if you could mark it as the accepted solution and provide kudos. This will help fellow community members facing similar challenges.

Should you have any further queries, please feel free to reach out to the Microsoft Fabric community.

Thank you.

View solution in original post

12 REPLIES 12
v-pnaroju-msft
Community Support
Community Support

Hi dhanurjaya,

We kindly ask if your query has been resolved. If you have found a solution, please share it with the community to help others facing similar issues. If the issue persists, please provide sample data illustrating your problem in a usable format without including sensitive or unrelated information. Also, specify the expected outcome based on the sample data. If our response was helpful, kindly mark it as the accepted solution and give kudos to assist other community members. For further queries, feel free to reach out to the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi dhanurjaya,

We kindly wish to inquire whether your query has been resolved. If you have found a solution, we request you to share it with the community to assist others who may be facing a similar issue.

In case the issue persists, please provide sample data that clearly illustrates your problem in a usable format (excluding screenshots). Kindly ensure that no sensitive or unrelated information is included. Additionally, please specify the expected outcome based on the provided sample data.

If you found our response helpful, we would be grateful if you could mark it as the accepted solution and provide kudos. This will help fellow community members facing similar challenges.

Should you have any further queries, please feel free to reach out to the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi dhanurjaya,

Thank you for your patience.

To address your query: Does the formula CALCULATE(SUM('Sales'[SalesAmount]), 'Calendar'[FiscalYear] = LY) < = 0 return the full-year sales for the last year (LY) or only for the selected month?
This formula returns the full-year sales for the last year, as it is filtered solely by FiscalYear and not by month.

We would like to kindly check whether your query has been resolved. If you have found a solution, we request you to share it with the community to assist others who may be encountering a similar issue.

If the issue persists, please provide sample data that clearly illustrates your problem in a usable format (not as a screenshot). Kindly ensure that no sensitive or unrelated information is included. Additionally, please indicate the expected outcome based on the provided sample data.

If you found our response helpful, we would be grateful if you could mark it as the accepted solution and provide kudos. This will help fellow community members facing similar challenges.

Should you have any further queries, please feel free to reach out to the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi dhanurjaya,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

Hi,

Apologies for the delayed response. I have reviewed your measures, but I am having trouble understanding them.

Does CALCULATE(SUM('Sales'[SalesAmount]), 'Calendar'[FiscalYear] = LY) <= 0 return the full-year sales for last year, or just the sales for the selected month in last year?
 
The comparison of new customers for the current year with last year's full year is not an apples-to-apples comparison.

1. Logic for Month wise : customers last year full year sales value is <=0 and current year for the month value is >0 and current year till previous month value is <=0 (excluding Current month).

2. Logic for YTD: customers last year full year sales value is <=0 and current year YTD value is >0.

need Summary - 1     
Month on Month Trend    
MeasureFinacial Year (Apr-Mar)AprMayJunJul
New Customer Count2023-241101
New Customer Value2023-240.840.360.000.27
New Customer Count2024-253010
New Customer Value2024-250.430.000.280.00
      
YTD Trend     
MeasureFinacial Year (Apr-Mar)AprMayJunJul
New Customer Count2023-241223
New Customer Value2023-240.842.332.382.65
New Customer Count2024-253344
New Customer Value2024-250.430.470.753.74

 

need Summary - 2FTM JunYTD Jun
MeasureLY FTMCY FTMLY YTDCY YTD
New Customer Count0124
New Customer Value0.000.282.380.75
Ashish_Excel
Resolver V
Resolver V

Hi,

Share some data to work with and show the expected result.

Hi,

i am unable share data please find Logic & Required Summary. (Required All Measure in Dynamic)

 

1. Logic for Month wise : customers last year full year sales value is <=0 and current year month value is >0 and current year till previous month value is <=0.

 

2. Logic for YTD: customers last year full year sales value is <=0 and current year YTD value is >0.

 

need Summary - 1     
Month on Month Trend    
MeasureFinacial Year (Apr-Mar)AprMayJunJul
New Customer Count2023-241101
New Customer Value2023-240.840.360.000.27
New Customer Count2024-253010
New Customer Value2024-250.430.000.280.00
      
YTD Trend     
MeasureFinacial Year (Apr-Mar)AprMayJunJul
New Customer Count2023-241223
New Customer Value2023-240.842.332.382.65
New Customer Count2024-253344
New Customer Value2024-250.430.470.753.74

 

need Summary - 2FTM JunYTD Jun
MeasureLY FTMCY FTMLY YTDCY YTD
New Customer Count0124
New Customer Value0.000.282.380.75

 

Hi,

I will need data to work with.

v-pnaroju-msft
Community Support
Community Support

Hi dhanurjaya,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @DataNinja777, for your response.

Hi @dhanurjaya,

We appreciate your inquiry on the Microsoft Fabric Community Forum.

Please find attached the screenshot and the PBIX file which may assist in resolving the issue:

vpnarojumsft_0-1747730681676.png

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will help other community members who may have similar queries.

Should you have any further questions, please feel free to contact the Microsoft Fabric Community.

Thank you.

dhanurjaya
Frequent Visitor

hi,

result not sertified, i thin something wrong..

Logic : if X1234 dealers LY Full Year Value <=0 and CY Till Apr+May value is <=0 and CY FTM Jun value is >0 then NDNR for Jun.

i am unable find this logic in below dax

FTM ND =
 VAR SelectedMonth = MAX('Calendar Master'[Month])
 VAR CY = MAX('Calendar Master'[FY Year (BI)])
 VAR LY = CY-1
 RETURN
 CALCULATE(
    DISTINCTCOUNT('Dump - PRI'[Parent Customer]),
    FILTER(
        VALUES('Dump - PRI'[Parent Customer]),
        CALCULATE(SUM('Dump - PRI'[Sales Val. (Calc)]),'Calendar Master'[FY Year (BI)] = LY) <=0 &&
        CALCULATE(
            SUM('Dump - PRI'[Sales Val. (Calc)]),
            'Calendar Master'[FY Year (BI)] = CY,
            'Calendar Master'[Month] = SelectedMonth
        ) >0
    )
 )
 
please help

 

DataNinja777
Super User
Super User

Hi @dhanurjaya ,

 

To calculate new and dropped dealers dynamically in Power BI using DAX, based on financial years running from April to March, we can use a combination of CALCULATE, FILTER, and SUM or DISTINCTCOUNT depending on whether you're counting dealers or summing their values. The key logic is to compare the current year's values with the previous year's and identify whether a dealer is considered "new" (no sales in the previous year, but sales in the current period) or "dropped" (sales last year, but none in the current period).

For FTM New Dealer count in the current year:

CY_FTM_NewDealer_Count :=
VAR SelectedMonth = MAX('DateTable'[Month])
VAR CY = MAX('DateTable'[FinancialYear])
VAR LY = CY - 1
RETURN
CALCULATE(
    DISTINCTCOUNT('Sales'[DealerID]),
    FILTER(
        VALUES('Sales'[DealerID]),
        CALCULATE(SUM('Sales'[SalesAmount]), 'DateTable'[FinancialYear] = LY) <= 0 &&
        CALCULATE(
            SUM('Sales'[SalesAmount]),
            'DateTable'[FinancialYear] = CY,
            'DateTable'[Month] = SelectedMonth
        ) > 0
    )
)

For FTM New Dealer value in the current year, replace DISTINCTCOUNT with SUM:

CY_FTM_NewDealer_Value :=
VAR SelectedMonth = MAX('DateTable'[Month])
VAR CY = MAX('DateTable'[FinancialYear])
VAR LY = CY - 1
RETURN
CALCULATE(
    SUM('Sales'[SalesAmount]),
    FILTER(
        VALUES('Sales'[DealerID]),
        CALCULATE(SUM('Sales'[SalesAmount]), 'DateTable'[FinancialYear] = LY) <= 0 &&
        CALCULATE(
            SUM('Sales'[SalesAmount]),
            'DateTable'[FinancialYear] = CY,
            'DateTable'[Month] = SelectedMonth
        ) > 0
    )
)

For YTD New Dealer count in the current year:

CY_YTD_NewDealer_Count :=
VAR CY = MAX('DateTable'[FinancialYear])
VAR LY = CY - 1
RETURN
CALCULATE(
    DISTINCTCOUNT('Sales'[DealerID]),
    FILTER(
        VALUES('Sales'[DealerID]),
        CALCULATE(SUM('Sales'[SalesAmount]), 'DateTable'[FinancialYear] = LY) <= 0 &&
        CALCULATE(
            SUM('Sales'[SalesAmount]),
            'DateTable'[FinancialYear] = CY,
            'DateTable'[Date] <= MAX('DateTable'[Date])
        ) > 0
    )
)

The value version of the above just replaces DISTINCTCOUNT with SUM as before.

For FTM Dropped Dealer count in the current year:

CY_FTM_DroppedDealer_Count :=
VAR SelectedMonth = MAX('DateTable'[Month])
VAR CY = MAX('DateTable'[FinancialYear])
VAR LY = CY - 1
RETURN
CALCULATE(
    DISTINCTCOUNT('Sales'[DealerID]),
    FILTER(
        VALUES('Sales'[DealerID]),
        CALCULATE(
            SUM('Sales'[SalesAmount]),
            'DateTable'[FinancialYear] = LY,
            'DateTable'[Month] = SelectedMonth
        ) > 0 &&
        CALCULATE(
            SUM('Sales'[SalesAmount]),
            'DateTable'[FinancialYear] = CY,
            'DateTable'[Month] = SelectedMonth
        ) <= 0
    )
)

And again, swap in SUM for the value version. You can apply similar logic for YTD dropped dealers by using Date <= MAX('DateTable'[Date]) within each year. This will give you a clean way to dynamically compute new and dropped dealers based on fiscal year, specific month selection, or year-to-date range.

 

Best regards,

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.