Forum Discussion
Comparison between Selected Days and Previous Days
- Anonymous3 years ago
Hi mohammadyousaf ,
According to my test results, the results of Previous Period are displayed normally. Please point out if I misunderstood.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mohammadyousaf ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create measures.
Current Period =
CALCULATE(
DISTINCTCOUNT(tbl_1 [ID_No]),
DAY(tbl_1[Date] = DAY(TODAY())))Previous Period = CALCULATE('Table'[Current Period],FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])-3))Current Selected Period (days) = SUMX(ALLSELECTED('Table'),'Table'[Current Period])Previous Period ( days beyond selected days) = SUMX(ALLSELECTED('Table'),'Table'[Previous Period])
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Thank you for your response. It seems like I am getting the partial results results, please see below screenshot.
it is worth to mention that in my table I only have Date & Current period and trying to calculate Previous Period using Dax.
I have used the Dax as:
Thank you in advance for your help.
- Anonymous3 years agoNot applicable
Hi mohammadyousaf ,
It doesn't seem to be a problem in my example file.
Please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang