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
Anonymous
Not applicable

Begginer question: Basic calculation formula

Hello, I'm stuck since 2 hours on something very basic and I really have no idea on how to do.

HenriD_0-1645267254241.png

I have 8000 transactions like this and I need to calculate the "Amount Of Days that have transactions" that I would put in this table (in the blue) to have it for each products.

HenriD_1-1645267381994.png

I was at first thinking to use Count and Distinctcount to find the solution but it wasn't the results expected. I'm maybe missing something very easy, but I currently don't see it...

Do you have a tips on how I could do please?

(Picture of the final results expected)

HenriD_2-1645267567930.png

 

Thank you very much !!

Henri Dethoor

1 ACCEPTED SOLUTION
vishalgupta29
Frequent Visitor

Hi @Anonymous 

 

I got the solution for you problem. You can drag date column from receipt table. I have attached screenshot below for your reference.

vishalgupta29_0-1645283894096.png

Please mark this as solution if it works.

View solution in original post

7 REPLIES 7
vishalgupta29
Frequent Visitor

Hi @Anonymous 

 

I got the solution for you problem. You can drag date column from receipt table. I have attached screenshot below for your reference.

vishalgupta29_0-1645283894096.png

Please mark this as solution if it works.

Anonymous
Not applicable

Thank you, I feel very stupid, I think I focused too much on "Day" and not the full date. I'll try to understand why I did this mistake now !

Thank you!!!

sarathkankanala
New Member

day count = calculate(DISTINCTCOUNT(Orders[Order Date])) 
in your case its transaction date
when you drag that measure to the matrix table it will gives catogery wise count of days.
 
Anonymous
Not applicable

Hello! I've already tried this possibilty and as you can see in the screenshot I just get 31 everywhere. While my results should be: 87,85,88... Thank you for trying

HenriD_1-1645279342031.png

 

 

Anonymous
Not applicable

Hello, thank you for your answers! I tried to look for my DAX code but I didn't find how I should do (I'll make some research for my next topics about how I need to do). For the moment you can find my data in this link. You don't need to mind about all of them: Only the page "Task 2PTS" and "Tooltip3" + the tables Blaknes / Employee / Products / Receipt can be used.

 

I tried your solution with Countx but it didn't made the solution I expected sorry. I tried with different values also!

Thank you everyone.

 

https://wetransfer.com/downloads/7ef429368892372619e0a2bea4d5482320220219125527/a70e753875fcc8b77f8f...

vishalgupta29
Frequent Visitor

Hi @Anonymous 

 

you can use countx funtion to calculate the number of days as mentioned below.

 

=countx(values(product),count(product))

 

you can share the pbix file or you dax formula if this not helps.

 

Please mark this as solution if this helps you.

DavisBI
Solution Specialist
Solution Specialist

@Anonymous  Hi. Could share your DAX code?

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.