The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
For example, if the viewer selects two values in the slicer (record1 and record2) and Monday and Tuesday has no data, I want the calculation to be 0% + 100% / 9 * 2. However, the calculation is calculated as 100% / 9 * 1.
Sorry if the solution is posted elsewhere but I have tried looking for one.
It seems like you want to calculate a percentage based on the number of selected values in a slicer, and you want to include days with no data in the calculation. To achieve this, you can modify your DAX measure to consider all the days, even those with no data.
Here's a modified version of your DAX measure:
Slicer Count =
COUNTROWS(VALUES(SomeTable[SomeColumn]))
Another DAX measure =
VAR divisor = 9 * [Slicer Count]
RETURN
DIVIDE(
CALCULATE(
[another measure which sums some values],
ALL(Date)
),
divisor,
0
)
n this modified measure:
CALCULATE([another measure which sums some values], ALL(Date)) calculates the sum of your values, but with the context of all dates. This ensures that even if a date has no data, it is still considered in the calculation.
DIVIDE(..., divisor, 0) handles the division and includes a default value of 0 in case the divisor is 0.
This modification should give you the desired behavior where days with no data are included in the calculation, and the percentage is based on the total number of selected values in the slicer.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |