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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
answeriver
Helper IV
Helper IV

Speed of distribution

Hi all,

Please tell me can i make report of distibution new product with DAX formula?

I have data with sales, date, outlets, cities, products. 

So i need to made report of counting outlets which purchase one of product and show it information by cities and weeks.

Early i made it in excel with manual calculation, but now i need made it for many products separate from each other.

11 REPLIES 11
v-yulgu-msft
Employee
Employee

Hi @answeriver,

 

I am not clear about your requirement. Please follow this blog to provide sample data and show us your desired output.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Yuliana,

Actually i aldready made report by this function:

Running Total Distr = CALCULATE(DISTINCTCOUNT(IMS[SALEPOINT CODE]);FILTER(ALLSELECTED(IMS);IMS[VISIT DATE]<=MAX(IMS[VISIT DATE])))

And have this results:

WEEK NUMRunnunig Total Disrt
38345
39662
40779
41835
42852
43875
441016
451279
461326
471371
481419

 

Sorry i can't insert image? i dont know how.

But when i try add split by cities, function not working.

Hi @answeriver,

 

I noticed that you calculate running total value based on "VISIT DATE" column, but you didn't add this column into visual, instead you put "WEEK NUM". Is this expected? Besides, if adding "City" column into visual, what the desired result should be?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear Yuliana,

About week num it's ok, calculating working. On the image you can see running total for all country, but in my data have cities.

I want count outlets which purchase product by cities with cumulative count.

Hi @answeriver,

 

Maybe you can try this:

Running Total Distr =
CALCULATE (
    DISTINCTCOUNT ( IMS[SALEPOINT CODE] );
    FILTER (
        ALLSELECTED ( IMS );
        IMS[CITY] = SELECTEDVALUE ( IMS[CITY] )
            && IMS[VISIT DATE] <= MAX ( IMS[VISIT DATE] )
    )
)

 

For more advice, you'd better post sample data in source table and show us the desired output that shows running total values with weeknum and cities in a single visual.


Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear Yuliana,

Your solution is not working

Capture.PNG

That what i want to see

Capture1.PNG How i can add file?

Hi @answeriver

 

You can upload your pbix file to any file hosting site like dropbox or google and share the link here.

 

Hi @answeriver

 

Please confirm if you are looking for a result similar to below shown 

weeknum city.png

 

 

Regards

Affan

Hi Affan, Do you have some news?

Dear Affan,

Thanks for your time.

https://drive.google.com/open?id=1320oYQ3Jdm304zAkAvggurkHwcTNm1nf

Here is my manual calculation for report, like my way. What i want is max of final results what i can get with DAX.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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