Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Analitika
Post Prodigy
Post Prodigy

Selecting multiple items at time in Power BI

Hi,

 

I would like to ask is possible to make that within one measure to able to visualize multiple lines at time?

For example, I select 2021, 2022 years at time and expect to see two lines in visual. Visual lines number depends on selected years.

Analitika_0-1673870010237.png 

Below is date slicer.

Analitika_0-1673873045940.png

 

This is how looks visual. Green line expression:

 

Pardavimai santykis_h_k1_kiek_test = 
var metu_uzdarymo_pozymis=[ABC_Metu_uzdarymo_ZU0_KOD]
var selected=SELECTEDVALUE('Date'[Metai])
var valandos= CALCULATE([kiek],FILTER('view_ziniarast_cp','view_ziniarast_cp'[year] = selected))
/*var savikaina= sumx(FILTER('DBA view_DidknObj', RELATED('Sas kod unik BRIDGE'[POZYMIAI Veiklu (Excel AUTO)])="Savikaina"&&Find(metu_uzdarymo_pozymis,'DBA view_DidknObj'[ZU0_KOD],,0)=0), 'DBA view_DidknObj'[SUM_DEB]-'DBA view_DidknObj'[SUM_CRE])*/
return


if([kiek]=BLANK(),"",DIVIDE([BP Pardavimai DK+-50],valandos))

 

year is equal selected but it works only if I select one year in date slicer, whenever I select more than one year, nothing appears, no lines. So how to resolve this issue?

2 REPLIES 2
negi007
Community Champion
Community Champion

@Analitika you can put year in the legend like below. 

 

negi007_0-1673879133204.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

But I am using line and clustured column chart. And line is a separate measure. One measure for columns and another measure for lines in visual. 

Analitika_0-1673879404042.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.