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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
KevinPr
New Member

Total count of products by day

Hi, 

 

I am trying to show the total count for each subscriptions for each day of the month.  The report is showing the right grand total, but the days of the month is showing the I thinking the total subscriptions sold on that day of the month over time.

 

DAX Code-

Packages =
CALCULATE(
    DISTINCTCOUNT(Subscription_Data_171[Standard_Sales_Code]),
        Filter(
            CROSSJOIN(
            VALUES(Subscription_Data_171),
            VALUES(ItemCategories_List[Code])
            ),
             (
             YEAR(Subscription_Data_171[Contract_End_Date]) < 1950 ||
             Subscription_Data_171[Contract_End_Date]> DATE(YEAR(MAX(Subscription_Data_171[Contract_Start_Date])),MONTH(MAX('Subscription_Data_171'[Contract_Start_Date])),1)
           &&
             Subscription_Data_171[Contract_Start_Date] <= DATE(YEAR(Max(Subscription_Data_171[Contract_Start_Date])),MONTH(Max(Subscription_Data_171[Contract_Start_Date])),31) &&
             YEAR(Subscription_Data_171[Contract_Start_Date]) > 1950 &&
            ItemCategories_List[Code] = "DIGITALTV"
             
              )

            )
    )
 
Result
KevinPr_0-1706822364816.png

The total on each day should be close to the grand total. 

 

Example: at the start of the month the 210 could have been 200.  

 

Da1 = 200 .... Day 31 = 210.

 

Thank you,

 

This my first post and I am new to learning power bi & dax. 

@count
3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with, explain the question and show the expected result.  With just a measure that you have posted, it is nt possible to understand your requirement.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you for replying. 

- The data for the report is coming from Business Central - Subscription Data table

- I am using a crossjoin to connect the ItemCategories_List table to filter the subscrption Group.

- The report should show the peek total number of subscriptions per month for the selected year

- To determine if a subscrption is active I am using the Contract Start date and Contract End date from the Subscription Data table

* If the contract started before the first day of the month & the contract end date is before the last day of the month then count the subscription. 

Screen shot of Subscription Data table

KevinPr_0-1706880525375.png

 

Sample result. Shos the total for each month. 

SubscriptionJanFebMarAprMayJunJulAugSepOctNovDec
BUNDLEBASICBILINGUAL195199195198197198198199200205210210
BUNDLEBASICFRANCOTV626068686562686969707172
BUNDLECOMPLETETV41414546484742404584951
NOBUNBASICBILINGUATV202022242726202428282928

 

I hope this helps clarify and Thank you for the support. 

 

 

Hi,

I have solved a similar problem in the attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.