Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Team,
if I selecting a two week then i want to show the var% between the value.
Thanks,
DK
Solved! Go to Solution.
Hi, I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
INDEX function (DAX) - DAX | Microsoft Learn
Sales measure: =
VAR _sales =
SUM ( Data[Sales] )
VAR _weekselectcondition =
COUNTROWS ( DISTINCT ( Week[Week] ) ) = 2
VAR _totalcolumn =
NOT ( HASONEVALUE ( Week[Week] ) )
VAR _salesone =
CALCULATE (
SUM ( Data[Sales] ),
INDEX ( 1, VALUES ( Week[Week] ), ORDERBY ( Week[Week], ASC ) )
)
VAR _salestwo =
CALCULATE (
SUM ( Data[Sales] ),
INDEX ( 1, VALUES ( Week[Week] ), ORDERBY ( Week[Week], DESC ) )
)
VAR _percentage =
FORMAT ( DIVIDE ( _salestwo - _salesone, _salesone ), "#0.00%" )
RETURN
IF ( _weekselectcondition && _totalcolumn, _percentage, _sales )
Hi, I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
INDEX function (DAX) - DAX | Microsoft Learn
Sales measure: =
VAR _sales =
SUM ( Data[Sales] )
VAR _weekselectcondition =
COUNTROWS ( DISTINCT ( Week[Week] ) ) = 2
VAR _totalcolumn =
NOT ( HASONEVALUE ( Week[Week] ) )
VAR _salesone =
CALCULATE (
SUM ( Data[Sales] ),
INDEX ( 1, VALUES ( Week[Week] ), ORDERBY ( Week[Week], ASC ) )
)
VAR _salestwo =
CALCULATE (
SUM ( Data[Sales] ),
INDEX ( 1, VALUES ( Week[Week] ), ORDERBY ( Week[Week], DESC ) )
)
VAR _percentage =
FORMAT ( DIVIDE ( _salestwo - _salesone, _salesone ), "#0.00%" )
RETURN
IF ( _weekselectcondition && _totalcolumn, _percentage, _sales )
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |