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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

New Report

Hello!

I started a new job to help with sales using Power BI. Well I'm not a Power BI expert, I know the basics.

The problem is that I'm trying to understand how the report was created (the logic behind it), and there are at least 30 measures with names that don't help to understand why they were created nor comments to facilitate. I'm having trouble understanding each one, mainly because they are interconnected (the measures).

Any ideas or advice on how to better understand this report?

 

Here's an exemple:

This measure % ∆  was created using another two other measures:

% ∆ = DIVIDE([Cnpjs IDs/Qty],[Total Resellers],0)

 

So here´s the Cnpjs IDs/Qty:

Cnpjs IDs/Qty = SWITCH

(SELECTEDVALUE(Formato[Formato]),

"Qty",[CNPJ compraram com ID],

"Volume",[Total_Vol_ID´s])

 

And Total Resellers:

Total Resellers =SWITCH
(SELECTEDVALUE(Formato[Formato]),"Qty",DISTINCTCOUNT(ChannelDnaReport[POSSoldToCustomerTaxIdRoot]),"Volume",SUM(ChannelDnaReport[SellThruProductUnits]))
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous ,

SWITCH function is like a shorthand IF. It is easier to read than having many IF STATEMENTS.

Cnpjs IDs/Qty =
SWITCH (
    SELECTEDVALUE ( Formato[Formato] ),
    "Qty", [CNPJ compraram com ID],
    "Volume", [Total_Vol_ID´s]
)

The above formula tells that if the value selected from Formato column in the Formato table is Qty then it will return the measure [CNPJ compraram com ID] and if volume then [Total_Vol_ID´s]

Total Resellers =
SWITCH (
    SELECTEDVALUE ( Formato[Formato] ),
    "Qty", DISTINCTCOUNT ( ChannelDnaReport[POSSoldToCustomerTaxIdRoot] ),
    "Volume", SUM ( ChannelDnaReport[SellThruProductUnits] )
)

The above formula is very similar to the previous one except that instead of refrencing a measure when a value is selected from Formato[Formato], an aggregate expression is used - DISTINCTCOUNT(ChannelDnaReport[POSSoldToCustomerTaxIdRoot]) or SUM(ChannelDnaReport[SellThruProductUnits])

Both formulas will return blank/null if no value is selected from Formato[Formato] unless another condition is added to them to return otherwise.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hey @danextian 

That made things more clear, definitely.

Thank you

danextian
Super User
Super User

Hi @Anonymous ,

SWITCH function is like a shorthand IF. It is easier to read than having many IF STATEMENTS.

Cnpjs IDs/Qty =
SWITCH (
    SELECTEDVALUE ( Formato[Formato] ),
    "Qty", [CNPJ compraram com ID],
    "Volume", [Total_Vol_ID´s]
)

The above formula tells that if the value selected from Formato column in the Formato table is Qty then it will return the measure [CNPJ compraram com ID] and if volume then [Total_Vol_ID´s]

Total Resellers =
SWITCH (
    SELECTEDVALUE ( Formato[Formato] ),
    "Qty", DISTINCTCOUNT ( ChannelDnaReport[POSSoldToCustomerTaxIdRoot] ),
    "Volume", SUM ( ChannelDnaReport[SellThruProductUnits] )
)

The above formula is very similar to the previous one except that instead of refrencing a measure when a value is selected from Formato[Formato], an aggregate expression is used - DISTINCTCOUNT(ChannelDnaReport[POSSoldToCustomerTaxIdRoot]) or SUM(ChannelDnaReport[SellThruProductUnits])

Both formulas will return blank/null if no value is selected from Formato[Formato] unless another condition is added to them to return otherwise.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.