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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Analitika
Post Prodigy
Post Prodigy

Adding lines in visual which corresponds to year in Power BI

Hi,

 

I would like to ask how make that visual will contain separate lines according to selected year. Now I have a measure:

 

Pardavimai santykis_h = 
var metu_uzdarymo_pozymis=[ABC_Metu_uzdarymo_ZU0_KOD]
var valandos= CALCULATE([kiekis_h], all('Sas kod unik BRIDGE'[POZYMIAI Veiklu (Excel AUTO)]),all('Sas kod unik BRIDGE'[Sąskaitos pavadinimas]), all('Sas kod unik BRIDGE'[Pajamu sanaudu vaizdavimas (PAVADINIMAI)]),ALL('DBA view_DidknObj'[DID_NR]),ALL('DBA view_DidknObj'[DID_DAT]),ALL('DBA view_DidknObj'[OBJ_KOD]),ALL('DBA view_DidknObj'[Saskaitos numeris]),ALL('DBA klient_tiekejai'[kli_pav]))
/*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([kiekis_h]=BLANK(),"",DIVIDE([_2_1_1_Pardavimai (priklauso nuo vienetų pasirinkimo)],valandos))

 

Here is a visual:

Analitika_0-1665381978434.png

Green line shows data summing two years, it is general line. I need to make that if I select two year, then two lines appear in visual according to years, for example, in this case: 2021 and 2022 line of same measure. How I could achieve this? Visual type is -  Line and clustured column chart.

 

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Analitika ,

Sorry I'm not very clear about your expected result, would you like to explain more about it?

Best Regards,
Community Support Team _ kalyj

Yes, the essence of my goal is to create visual which contains sales columns as usual, previous photo, also adding that new lines will be separated (the lines number depends on selected years in the slicer ( number of lines equal to number of selected years and so on.) How to achieve this:

Current visual looks like this:

Analitika_1-1665487872015.png

Line measure is that:

 

Veiklos sąnaudų santykis_h = 
var metu_uzdarymo_pozymis=[ABC_Metu_uzdarymo_ZU0_KOD]
var valandos= CALCULATE([kiekis_h], all('Sas kod unik BRIDGE'[POZYMIAI Veiklu (Excel AUTO)]),all('Sas kod unik BRIDGE'[Sąskaitos pavadinimas]), all('Sas kod unik BRIDGE'[Pajamu sanaudu vaizdavimas (PAVADINIMAI)]),ALL('DBA view_DidknObj'[DID_NR]),ALL('DBA view_DidknObj'[DID_DAT]),ALL('DBA view_DidknObj'[OBJ_KOD]),ALL('DBA view_DidknObj'[Saskaitos numeris]),ALL('DBA klient_tiekejai'[kli_pav]))
/*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


DIVIDE([_6_1_0_VS Sanaudos veiklos],valandos)

 

 

Help me pls to get that result.

 

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.