The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a date table used as a slicer for the the user and looks like
PeriodName, PeriodDate, PeriodKey
2019, 1/1/2019, 20191/1/2019
....
2019, 12/31/2019, 201912/31/2019
2020, 1/1/2020, 20201/1/2020
...
2020, 12/31/2020, 202012/31/2020
The PeriodKey Relates to a table containing the numbers for which I would like to get the % From.
PeriodKey, Value
20191/1/2019, 23
20193/30/2019, 19
....
20202/23/2020, 40
20204/23/2020, 45
I want to be able to get the Sum of the Value field based on the Period that the user has selected i.e.
if selected 2019 I should see 23+19 = 42, regardless of any other filters that may be applied. i.e. not other filters are allowed except the PeriodName
I have tried this but it did not work.
which works exactly like
Sum('pbi pmd'[mm])
When other filters are applied.
Matbe it would help if I posted a pic of the model, The report period is in the 'pbi vwCustomerReportPeriods' table and the slicer field is PeriodName. The table I want to sum is 'pbi PMD' and the Column is MM, as you can see the 2 tables are related by PBI_RptPeriodKey, in the current setting, this actually works in the contex that I can add filters such as Spouse, Male, Female, etc. ant the calculation is correct, but I cannot explain why.
MMPeriod = Calculate(Sum('pbi pmd'[mm]), allexcept('pbi PMD', 'pbi PMD'[MM]))
@spartan27244 Maybe:
Period Sum =
VAR __Period = SELECTEDVALUE('Date Table'[PeriodName])
VAR __Table = FILTER('Table containing the numbers',LEFT([PeriodKey])=__Period)
RETURN
SUMX(__Table,[Value])
User | Count |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |