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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How to display values on the first and second levels of the hierarchy but not on the third and fourt

Hello, I have this report with this measure. I need to display the values only for the first and second level like here.

andria_hatala_0-1686812532455.png

But if I click on the lower hierarchy, the values disappear and I need to have them here:

 

andria_hatala_2-1686813133492.png

 

 

andria_hatala_1-1686812715778.png

I use this measure:

 

M_test = 
IF(ISINSCOPE(FIRST HIERARCHY) && NOT(ISINSCOPE(second hierarchy))  
|| NOT(ISINSCOPE(FIRST HIERARCHY))  && NOT(ISINSCOPE(second hierarchy)) 
|| ISINSCOPE(second hierarchy) && NOT(ISINSCOPE(third hierarchy)) 
|| ISINSCOPE(FIRST HIERARCHY)  && (ISINSCOPE(second hierarchy)) && NOT(ISINSCOPE(third hierarchy)),
        IF(ISBLANK([M_mesiaca]) && ISBLANK([M_plan_ks]),
                   BLANK(),
                   SUM(fakturacia[ks])
           ))

Thanks for help.

5 REPLIES 5
Anonymous
Not applicable

Hi.
First of, the query you're trying to perform does not have proper brackets.
Basically you have written this :

IF(
	1  & !2   or 
	!1 & !2   or
	!2 & !3   or
	1  & 2    or
	!3,
	IF(
        ISBLANK( [M_mesiaca] ) && ISBLANK( [M_plan_ks] ),
        BLANK(),
        SUM( fakturacia[ks] )
    )
)

You must rather write the query like (shown below) : 

IF(
	(1  & !2 )  or   //note here I have added the brackets appropriately
	(!1 & !2 )  or
	(!2 & !3 )  or
	(1  & 2  )  or
	(!3,
	
	IF(
        ISBLANK( [M_mesiaca] ) && ISBLANK( [M_plan_ks] ),
        BLANK(),
        SUM( fakturacia[ks] )
    )
)


Now, coming to the logic, AFAIK, the values must come automatically, but don't know why it is not showing. 
Can you please explain the requirement again with proper table names, and data?

Thank you.


Anonymous
Not applicable

If I display the second hierarchy, the data is correct. But if I display the third and fourth hierarchy, the data is lost. I need to get the data into the total.

 

Snímka obrazovky 2023-06-15 215313.png

Snímka obrazovky 2023-06-15 215331.png

 

M_planovana_fakturacia_ks_test = 
 IF(ISINSCOPE(tcj04[VERNA]) && NOT(ISINSCOPE(spp_prvky_prps[C_combined_poski_text]))  || NOT(ISINSCOPE(tcj04[VERNA]))  && NOT(ISINSCOPE(spp_prvky_prps[C_combined_poski_text])) || ISINSCOPE(spp_prvky_prps[C_combined_poski_text]) && NOT(ISINSCOPE(spp_prvky_prps[Dávka])) || ISINSCOPE(tcj04[VERNA])  && (ISINSCOPE(spp_prvky_prps[C_combined_poski_text])) && NOT(ISINSCOPE(spp_prvky_prps[Dávka])),
            
                                            IF(
                                            ISBLANK([M_rozdiel_ks_do_konca_minuleho_mesiaca]) && ISBLANK([M_plan_ks]),
                                            BLANK(),
                                            SUM(planovana_fakturacia[ks])
                                        ))

@andria_hatal can you please know that your First hierarchy,second hierarchy,third and fourth hierarchy in one table or different table.

Anonymous
Not applicable

it is in different tables

@Anonymous Can you please share your Datamodeling of table.

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.