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.
Solved! Go to Solution.
Hi @wemsomba10 ,
According to your code, I think your issue should be caused by IF() and ISFILTERED() function.
Selected In Report =
IF (
ISBLANK (
VAR Mth =
CALCULATE (
SUM ( My_spend_data[wins] ),
My_spend_data[Report Month Select Name]
= SELECTEDVALUE ( 'Selected Time Period'[Month Year] )
)
VAR Qtr =
CALCULATE (
SUM ( My_spend_data[In Report] ),
My_spend_data[Report Quarter Select Name]
= SELECTEDVALUE ( 'Selected Time Period'[Quarter Year] )
)
VAR Yr =
CALCULATE (
SUM ( My_spend_data[In Report] ),
My_spend_data[Report Year]
= SELECTEDVALUE ( 'Selected Time Period'[Report Year] )
)
RETURN
IF (
ISFILTERED ( 'Selected Time Period'[Month Year] ),
Mth,
IF (
ISFILTERED ( 'Selected Time Period'[Quarter Year] ),
Qtr,
IF ( ISFILTERED ( 'Selected Time Period'[Report Year] ), Yr )
)
)
),
0
)
There is no [Month Year]/[Quarter Year]/[Report Year] in subtotal, so it will return 0.
Here I suggest you to use SUMX() function to create a new measure based on [Selected in Report] measure.
If your visual is created by [Month Year]/[Quarter Year]/[Report Year] columns and [Selected in Report] measure, I suggest you to create a virtual table by SUMMARIZE().
Selected In Report (New) =
SUMX (
SUMMARIZE (
'Selected Time Period',
[Report Year],
[Quarter Year],
[Month Year]
),
[Selected in Report]
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You need to ensure that your measure is explicitly handling totals by aggregating the results properly.
Corrected Measure:
Selected In Report =
VAR Mth =
CALCULATE (
SUM(My_spend_data[wins]),
My_spend_data[Report Month Select Name] = SELECTEDVALUE('Selected Time Period'[Month Year])
)
VAR Qtr =
CALCULATE (
SUM(My_spend_data[In Report]),
My_spend_data[Report Quarter Select Name] = SELECTEDVALUE('Selected Time Period'[Quarter Year])
)
VAR Yr =
CALCULATE (
SUM(My_spend_data[In Report]),
My_spend_data[Report Year] = SELECTEDVALUE('Selected Time Period'[Report Year])
)
VAR Result =
IF(
ISFILTERED('Selected Time Period'[Month Year]), Mth,
IF(
ISFILTERED('Selected Time Period'[Quarter Year]), Qtr,
IF(ISFILTERED('Selected Time Period'[Report Year]), Yr, BLANK())
)
)
RETURN
IF(
NOT(ISINSCOPE('Selected Time Period'[Month Year])) &&
NOT(ISINSCOPE('Selected Time Period'[Quarter Year])) &&
NOT(ISINSCOPE('Selected Time Period'[Report Year])),
SUMX(
VALUES('Selected Time Period'[Month Year]),
Result
),
Result
)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Hi @wemsomba10 ,
According to your code, I think your issue should be caused by IF() and ISFILTERED() function.
Selected In Report =
IF (
ISBLANK (
VAR Mth =
CALCULATE (
SUM ( My_spend_data[wins] ),
My_spend_data[Report Month Select Name]
= SELECTEDVALUE ( 'Selected Time Period'[Month Year] )
)
VAR Qtr =
CALCULATE (
SUM ( My_spend_data[In Report] ),
My_spend_data[Report Quarter Select Name]
= SELECTEDVALUE ( 'Selected Time Period'[Quarter Year] )
)
VAR Yr =
CALCULATE (
SUM ( My_spend_data[In Report] ),
My_spend_data[Report Year]
= SELECTEDVALUE ( 'Selected Time Period'[Report Year] )
)
RETURN
IF (
ISFILTERED ( 'Selected Time Period'[Month Year] ),
Mth,
IF (
ISFILTERED ( 'Selected Time Period'[Quarter Year] ),
Qtr,
IF ( ISFILTERED ( 'Selected Time Period'[Report Year] ), Yr )
)
)
),
0
)
There is no [Month Year]/[Quarter Year]/[Report Year] in subtotal, so it will return 0.
Here I suggest you to use SUMX() function to create a new measure based on [Selected in Report] measure.
If your visual is created by [Month Year]/[Quarter Year]/[Report Year] columns and [Selected in Report] measure, I suggest you to create a virtual table by SUMMARIZE().
Selected In Report (New) =
SUMX (
SUMMARIZE (
'Selected Time Period',
[Report Year],
[Quarter Year],
[Month Year]
),
[Selected in Report]
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |