Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
Need some immediate assistance on this issue am facing. So, I have a Category Line Grouping table that looks like this:
Basically Line Name is the PK and it could belong to any of the different categories. Each Line Name on the Excel is a measure that is then consolidated and used on a matrix.
I've all the measures for each Line Item ready and if I display each Line Item along with the consolidated summary measure, it works fine and looks like this.
The problem occurs when I group these under their respective Category (I included both Category and Line Name on the columns). This is what it looks then when collapsed. As you can see for Volume and Net Revenue which have only one Line Name, the Summary displays the right number but for VILC/Unit and Total VILC which have 2 different line names the Summary column appears blank. I would expect the sum of VIC & VLC to appear under Total VILC. For VILC/Unit I would expect the sum of VIC/Unit and VLC/Unit.
When I expand the Total VILC and VILC/Unit though I see both the respective Line names. Its just that when I collapse it I don't see the sum showing up on the Category which I what I expect to see.
Is this expected behaviour of Power BI? Or is there something wrong or something else I need to do to fix this?
Would appreciate any help on this. Please let me know if you need more information!
Thank you.
Solved! Go to Solution.
Hey @Koushikrish,
At first glance, it looks like your SWITCH measure doesn't contemplate the scenario where it should calculate the top level category.
I would suggest adding conditions to contemplate that, like:
VAR LineName = SELECTEDVALUE( 'dimCategory'[Line Name] )
VAR Category = SELECTEDVALUE( 'dimCategory'[Category] )
RETURN
SWITCH(
TRUE(),
// Level 2
LineName = "VOLUME", CALCULATE ( [Volume] ),
LineName = "NET REVENUE", CALCULATE ( [Net_Revenue] ),
LineName = "VIC", CALCULATE ( [VIC] ),
LineName = "VLC", CALCULATE ( [VLC] ),
LineName = "VIC/Unit", CALCULATE ( [VICPerUnit] ),
LineName = "VLC/Unit", CALCULATE ( [VLCPerUnit] ),
// Level 1
Category = "VOLUME", CALCULATE ( [Volume] ),
Category = "NET REVENUE", CALCULATE ( [Net_Revenue] ),
Category = "VILC/Unit", CALCULATE ( [VICPerUnit] + [VLCPerUnit] ),
Category = "Total VILC", CALCULATE ( [VIC] + [VLC] )
)
Hey @Koushikrish,
At first glance, it looks like your SWITCH measure doesn't contemplate the scenario where it should calculate the top level category.
I would suggest adding conditions to contemplate that, like:
VAR LineName = SELECTEDVALUE( 'dimCategory'[Line Name] )
VAR Category = SELECTEDVALUE( 'dimCategory'[Category] )
RETURN
SWITCH(
TRUE(),
// Level 2
LineName = "VOLUME", CALCULATE ( [Volume] ),
LineName = "NET REVENUE", CALCULATE ( [Net_Revenue] ),
LineName = "VIC", CALCULATE ( [VIC] ),
LineName = "VLC", CALCULATE ( [VLC] ),
LineName = "VIC/Unit", CALCULATE ( [VICPerUnit] ),
LineName = "VLC/Unit", CALCULATE ( [VLCPerUnit] ),
// Level 1
Category = "VOLUME", CALCULATE ( [Volume] ),
Category = "NET REVENUE", CALCULATE ( [Net_Revenue] ),
Category = "VILC/Unit", CALCULATE ( [VICPerUnit] + [VLCPerUnit] ),
Category = "Total VILC", CALCULATE ( [VIC] + [VLC] )
)
Hello @Greg_Deckler ,
This is my measure formula. Can't really post my PBIX here, sorry about that.
SWITCH
(
SELECTEDVALUE( 'dimCategory'[Line Name] ),
"VOLUME", CALCULATE ( [Volume] ),
"NET REVENUE", CALCULATE ( [Net_Revenue] ),
"VIC", CALCULATE ( [VIC] ),
"VLC", CALCULATE ( [VLC] ),
"VIC/Unit", CALCULATE ( [VICPerUnit] ),
"VLC/Unit", CALCULATE ( [VLCPerUnit] )
)
Thanks for your help.
@Koushikrish What is your measure formula? Can you post a link to your PBIX?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |