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.
HI All
we have a requirement . when a user give the range of dates the out put should be as below on week basis ,
In the above example fact table have data only in 2nd week , the 1st week is not having any data , still we need to show with zeros above , the problem here is we have to create average for those 2 weeks .
so to create average we tried like this
AvgSum = CALCULATE(sumx(View_Compliance,View_Compliance[Compliance %]),ALLSELECTED('Date'[Week Ending]))
Avgcount = CALCULATE(Distinctcount([Week Ending]),ALLSELECTED('Date'[Week Ending]))
The avg sum is getting correct , but avg count of weeks we are getting only 1 , we should get 2 in ooour case but it is giving only 1 as we have data for only 1 week.
i have tried
AvgCount_1 = CALCULATE(Distinctcount('Date'[Week Ending]), DATESBETWEEN('Date'[Day],[StartDate], [EndDate] ) )
The StartDate = FIRSTDATE('Date'[Day]) and EndDate = LASTDATE('Date'[Day])
still same result . is there any value we can get 2 een though we dont have any data for 1st week in fact .
Solved! Go to Solution.
Hi @Surendra_thota,
Please try to use the following formula, and check if it works.
Avgcount_test = Distinctcount([Week Ending])
Best Regards,
Angelia
Hi @Surendra_thota,
Have you reslved your issue? If you have, please mark the right reply as answer, thanks.
Thanks,
Angelia
Hi @Surendra_thota,
Please try to use the following formula, and check if it works.
Avgcount_test = Distinctcount([Week Ending])
Best Regards,
Angelia
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
124 | |
113 | |
98 | |
81 | |
72 |