获得等效的最小百分比年
Getting equivalent min percentage year
我有下面的数据,其中显示了年份、价值和累计百分比
create table #data (cost money, Current_Year int, Cumulative money, [Percentage] decimal(9,4))
insert into #data values
(43000000,2014,43000000,0.000647922726779209),
(54000000,2015,97000000,0.00146159312785077),
(60777777.75,2016,157777777.75,0.00237739088337079),
(123777777.8,2017,281555555.55,0.0042424707742277),
(126555555.5,2018,408111111.05,0.00614940613721881),
(60761257937,2019,61169369048.05,0.921698241604101),
(492914890.8,2020,61662283938.85,0.929125468583571),
(456692522.2,2021,62118976461.05,0.936006897985512),
(416673457.6,2022,62535649918.65,0.942285321307017),
(422831144,2023,62958481062.65,0.94865652846487),
(371598857.2,2024,63330079919.85,0.954255769042197),
(346364399,2025,63676444318.85,0.959474777550553),
(336826238.7,2026,64013270557.55,0.964550065341932),
(350483170.1,2027,64363753727.65,0.969831135371267),
(334551349.4,2028,64698305077.05,0.974872145198032),
(310619368.1,2029,65008924445.15,0.97955254863919),
(344523398.6,2030,65353447843.75,0.984743817008031),
(345189362.5,2031,65698637206.25,0.989945120101198),
(332918789.2,2032,66031555995.45,0.994961530559209),
(334382754.3,2033,66365938749.75,1)
select * from #data
drop table #data
我希望能够 select 我的过滤器中 94% 到 95% 之间的百分比 return 该百分比和百分比的等效最小年份
我试过了
95%Range = var result =IF([Cost constant %]>=0.94 && [Cost constant %]<=0.95,[Cost constant %],BLANK())
return
IF(result <>BLANK(),MAX(Calendar_Date[Current_Year])
它不工作
预期输出
)
我可以通过两种方式做到这些:
Min Year = min(Query1[Current_Year])
Percentage Lookup = LOOKUPVALUE(Query1[Percentage],Query1[Current_Year],[Min Year])
然后您可以将百分比添加到筛选器或切片器,Power BI 将 return 匹配筛选条件的最早年份。以下是简单 table 视觉效果的结果:
我有下面的数据,其中显示了年份、价值和累计百分比
create table #data (cost money, Current_Year int, Cumulative money, [Percentage] decimal(9,4))
insert into #data values
(43000000,2014,43000000,0.000647922726779209),
(54000000,2015,97000000,0.00146159312785077),
(60777777.75,2016,157777777.75,0.00237739088337079),
(123777777.8,2017,281555555.55,0.0042424707742277),
(126555555.5,2018,408111111.05,0.00614940613721881),
(60761257937,2019,61169369048.05,0.921698241604101),
(492914890.8,2020,61662283938.85,0.929125468583571),
(456692522.2,2021,62118976461.05,0.936006897985512),
(416673457.6,2022,62535649918.65,0.942285321307017),
(422831144,2023,62958481062.65,0.94865652846487),
(371598857.2,2024,63330079919.85,0.954255769042197),
(346364399,2025,63676444318.85,0.959474777550553),
(336826238.7,2026,64013270557.55,0.964550065341932),
(350483170.1,2027,64363753727.65,0.969831135371267),
(334551349.4,2028,64698305077.05,0.974872145198032),
(310619368.1,2029,65008924445.15,0.97955254863919),
(344523398.6,2030,65353447843.75,0.984743817008031),
(345189362.5,2031,65698637206.25,0.989945120101198),
(332918789.2,2032,66031555995.45,0.994961530559209),
(334382754.3,2033,66365938749.75,1)
select * from #data
drop table #data
我希望能够 select 我的过滤器中 94% 到 95% 之间的百分比 return 该百分比和百分比的等效最小年份 我试过了
95%Range = var result =IF([Cost constant %]>=0.94 && [Cost constant %]<=0.95,[Cost constant %],BLANK())
return
IF(result <>BLANK(),MAX(Calendar_Date[Current_Year])
它不工作
预期输出
)
我可以通过两种方式做到这些:
Min Year = min(Query1[Current_Year])
Percentage Lookup = LOOKUPVALUE(Query1[Percentage],Query1[Current_Year],[Min Year])
然后您可以将百分比添加到筛选器或切片器,Power BI 将 return 匹配筛选条件的最早年份。以下是简单 table 视觉效果的结果: