Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have written a measure to find out the percentage of the products which are missing. Below is the measure which I have written
Percentage of missing product = Coalesce(DIVIDE(
CALCULATE(
DISTINCTCOUNT('Table 1'[ID]),
FILTER('Table 1', Table 1 [Missing_Check] = 1)),
CALCULATE(DISTINCTCOUNT('Table 1'[ID]),0)
The above measure will interact with the Weekly snapshot slicer . Below is the sample data for the data slicer which is of type text. If i click any of the weekly snapshot below, the above measure will give the percentage for that particular week.This is working perfectly fine.
My Question is I want to compare the present week percentage value with the previous week percentage value based on the selection. Considering if I select any of the above weekly snapshot , I should get the respective percentage of that week [In a card visual ] and in the new measure [ another card visual ]which we are going to write should display the percentage of the previous week based on the that selection. I tried to write but somehow Its not working properly. For example if i select a date 4/24/2023 1st card is showing 20% then the second card should show the value of the previous week which is some percentage say 30% . And in the data we have week number as well, See below screenshot
Can anyone help me with the new measure please?
Hi @NaveenGandhi Thanks for the reponse. It is not working properly as you can see in the image the previous week's value is not correct. If I change the date slicer to the previous week, the value of the previous week should reflect in the 1st card, but it is showing wrong value. Please find the below screenshot for comparison
I Hope you understand my explanation. the previous week value should be the current week value, if I select the previous week date. In the above example 0.31 in the previous week of 1st screenshot should be the value of the current week in the second screenshot
Can you explain with respect to the second screenshot(5/15/2023 selected), which weeks data you want in current week's card and which weeks data in previous week card. Explain it using the respective week date for clarity.
Sure, in the second screenshot 5/15/2023 is the current week as we have selected that date, so the value in the current week card should give the value based on the selection 5/15/2023. But the previous week card should display the value of the previous week from the selected date (i.e) previous week to 5/15/2023 is 5/8/2023 so the second card should give the value for the date 5/8/2023. Hope this explains. Please let me know if you need further details
The measure i gave you should do the same as you expected for previous week, can you give me a sample data. I can test out in my file to see the output.
Please find the sample data below
Date Slicer | Week Number |
4/24/2023 | 16 |
3/27/2023 | 12 |
4/17/2023 | 15 |
4/3/2023 | 13 |
4/10/2023 | 14 |
Today | 21 |
5/29/2023 | 21 |
5/8/2023 | 18 |
5/15/2023 | 19 |
5/22/2023 | 20 |
5/1/2023 | 17 |
Today | 21 |
5/29/2023 | 21 |
5/29/2023 | 21 |
Today | 21 |
4/24/2023 | 16 |
3/27/2023 | 12 |
4/17/2023 | 15 |
4/3/2023 | 13 |
4/10/2023 | 14 |
Today | 21 |
Today | 21 |
5/29/2023 | 21 |
5/29/2023 | 21 |
5/8/2023 | 18 |
5/15/2023 | 19 |
5/22/2023 | 20 |
5/1/2023 | 17 |
Today | 21 |
5/29/2023 | 21 |
Today | 21 |
5/29/2023 | 21 |
5/29/2023 | 21 |
Today | 21 |
Today | 21 |
Today | 21 |
5/29/2023 | 21 |
5/29/2023 | 21 |
5/8/2023 | 18 |
5/22/2023 | 20 |
5/15/2023 | 19 |
5/1/2023 | 17 |
Today | 21 |
5/29/2023 | 21 |
5/29/2023 | 21 |
Today | 21 |
3/27/2023 | 12 |
4/10/2023 | 14 |
4/17/2023 | 15 |
4/3/2023 | 13 |
4/24/2023 | 16 |
5/22/2023 | 20 |
5/15/2023 | 19 |
5/8/2023 | 18 |
Today | 21 |
5/22/2023 | 20 |
5/29/2023 | 21 |
5/8/2023 | 18 |
4/10/2023 | 14 |
3/27/2023 | 12 |
5/15/2023 | 19 |
4/24/2023 | 16 |
4/3/2023 | 13 |
4/17/2023 | 15 |
2/13/2023 | 6 |
2/20/2023 | 7 |
3/20/2023 | 11 |
3/13/2023 | 10 |
2/27/2023 | 8 |
3/6/2023 | 9 |
It seems to be working as expceted. Check the attached PBIX to see the output.
For context. I have selected 5/08/2022. Below are the data for CW(5/08/2022) & PW(5/01/2022).
CW
PW
As per above data CW should be 20% and PW should be 66%.
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate your kudos!!
Hello @vicky2123131
Use the below measure for previous week.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |