Forum Discussion
The Value does not show when expand Metrix Table
- Anonymous1 year ago
Hi, cj_oat
When you delete either Consumer or Product, the Month Cover Measure has a value, which means:
When the external context satisfies both the Consumer and the Product, there is no corresponding data. So the result of the computation is empty, which is a very common external context problem.To do this, apply a calculate function to your original metric and remove one of the row label filters via removefilters or all.
Month Cover = VAR CurrentWeek = SELECTEDVALUE('Data Report'[Latest Week], MAX('Data Report'[Latest Week])) VAR SalesCalc = SWITCH(TRUE(), FORMAT(SELECTEDVALUE('Data Report'[Today]), "DDD") = "Mon", CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3), CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3 && 'Data Report'[Week Number] < CurrentWeek) ) RETURN CALCULATE(DIVIDE([Inventory], SalesCalc, BLANK()),REMOVEFILTERS('Data Report'[Consumer]))OR
Month Cover = VAR CurrentWeek = SELECTEDVALUE('Data Report'[Latest Week], MAX('Data Report'[Latest Week])) VAR SalesCalc = SWITCH(TRUE(), FORMAT(SELECTEDVALUE('Data Report'[Today]), "DDD") = "Mon", CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3), CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3 && 'Data Report'[Week Number] < CurrentWeek) ) RETURN CALCULATE(DIVIDE([Inventory], SalesCalc, BLANK()),ALL('Data Report'[Consumer]))Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi DataNinja777 ,
I have tried changing DAX but it still does not work (still showing BLANK), however, if I removed sub-row to have just only one row (either "Consumer" row or "Product" row) then the Month Cover will show correctly. Dont know why when I put sub-row then the Month Cover number disappeared.
Hi, cj_oat
When you delete either Consumer or Product, the Month Cover Measure has a value, which means:
When the external context satisfies both the Consumer and the Product, there is no corresponding data. So the result of the computation is empty, which is a very common external context problem.
To do this, apply a calculate function to your original metric and remove one of the row label filters via removefilters or all.
Month Cover =
VAR CurrentWeek = SELECTEDVALUE('Data Report'[Latest Week], MAX('Data Report'[Latest Week]))
VAR SalesCalc =
SWITCH(TRUE(),
FORMAT(SELECTEDVALUE('Data Report'[Today]), "DDD") = "Mon",
CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3),
CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3 && 'Data Report'[Week Number] < CurrentWeek)
)
RETURN
CALCULATE(DIVIDE([Inventory], SalesCalc, BLANK()),REMOVEFILTERS('Data Report'[Consumer]))
OR
Month Cover =
VAR CurrentWeek = SELECTEDVALUE('Data Report'[Latest Week], MAX('Data Report'[Latest Week]))
VAR SalesCalc =
SWITCH(TRUE(),
FORMAT(SELECTEDVALUE('Data Report'[Today]), "DDD") = "Mon",
CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3),
CALCULATE(SUM('Data Report'[Sales Unit]), 'Data Report'[Week Number] >= CurrentWeek - 3 && 'Data Report'[Week Number] < CurrentWeek)
)
RETURN
CALCULATE(DIVIDE([Inventory], SalesCalc, BLANK()),ALL('Data Report'[Consumer]))
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.