Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am pretty new to power bi and would like to calculate the sum of the max date in the below table
Product Id | Date |
1 | 7/21/2021 18:49 |
2 | 7/20/2021 18:49 |
3 | 7/19/2021 18:49 |
4 | 7/20/2021 18:49 |
5 | 7/21/2021 18:49 |
6 | 7/22/2021 18:49 |
7 | 7/22/2021 18:49 |
8 | 7/22/2021 18:49 |
9 | 7/22/2021 18:49 |
10 | 7/22/2021 18:49 |
In this case it is going to be 5. Could you please help me with the DAX.
Thanks
AD
Hi @Anonymous ,
You can try below code:-
count_of_dates =
CALCULATE ( COUNT ( 'Product_data'[Date] ), LASTDATE('Product_data'[Date]) )
output:-
Thanks
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Thank you so much. That worked. One last question. if I use the similar table with few more information :
Product | Date | Name | ADDRESS |
1 | 7/21/2021 18:49 | A | abc |
2 | 7/20/2021 18:49 | B | def |
3 | 7/19/2021 18:49 | C | dhk |
4 | 7/20/2021 18:49 | D | scj |
5 | 7/21/2021 18:49 | E | sbn |
6 | 7/22/2021 18:49 | F | sjx |
7 | 7/22/2021 18:49 | G | scn |
8 | 7/22/2021 18:49 | H | ivd |
9 | 7/22/2021 18:49 | I | skl |
10 | 7/22/2021 18:49 | J | kjs |
Now I want to create a table with product, name and address using the max date, how do I do that?
Hi @Anonymous
You can directly drag your fields on table visual and take a latest of your date. PFB screenshot for reference:-
Note:- You can get latest option when you right click on Date in Values Pane
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Anonymous ,
First, you need to find the Max, so you can write the below code to find the Max :
User | Count |
---|---|
25 | |
11 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |