Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have a raw data with the information per Yearmonth divided between priorities and with a Created sum.
Then in the Power BI Desktop, I've uploaded this information and created a variable to calculate the YTD.
YTD =
VAR RowDate = 'YTD'[Yearmonth]
RETURN
CALCULATE (
SUM ( 'YTD'[Created] );
FILTER (
ALL('YTD');
'YTD'[Yearmonth] <= RowDate
&& YEAR ( 'YTD'[Yearmonth]) = YEAR ( RowDate )
)
)And it works however with a slicer for the priority the YTD doesn't changed.
Can you please help me ?
Solved! Go to Solution.
It seems that you created a calculate column for the YTD. To make it changed based on the selection, you need to create a calculated measure with following formula.
YTD_Measure =
VAR RowDate =
CALCULATE ( MAX ( 'YTD'[Yearmonth] ) )
RETURN
CALCULATE (
SUM ( 'YTD'[Created] ),
FILTER (
ALLSELECTED ( 'YTD' ),
'YTD'[Yearmonth] <= RowDate
&& YEAR ( 'YTD'[Yearmonth] ) = YEAR ( RowDate )
)
)
Best Regards,
Herbert
It seems that you created a calculate column for the YTD. To make it changed based on the selection, you need to create a calculated measure with following formula.
YTD_Measure =
VAR RowDate =
CALCULATE ( MAX ( 'YTD'[Yearmonth] ) )
RETURN
CALCULATE (
SUM ( 'YTD'[Created] ),
FILTER (
ALLSELECTED ( 'YTD' ),
'YTD'[Yearmonth] <= RowDate
&& YEAR ( 'YTD'[Yearmonth] ) = YEAR ( RowDate )
)
)
Best Regards,
Herbert
Hi Herbert (@v-haibl-msft),
Now I would like to show just a shorter number of yearmonths but if I remove yearmonths the YTD values change and the YTD for P12 2016 for example isn't the total of the year even if I have the data available in the raw data.
Is there a way to shorten the view but keeping the values ?
Thanks,
Filipa
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 119 | |
| 100 | |
| 72 | |
| 69 | |
| 65 |