filmov
tv
Dynamic Columns Based on Slicer Selection in Power BI
Показать описание
*TO ACCOUNT FOR TOTALS FOLLOW THESE STEPS*
1) Edit your Avg Tempo Dimension Slicer Measure
2) Set your original switch statement to the variable N
3) Create a new variable called T to take care of the scenario in which SELECTEDVALUE() is BLANK() (AKA when DAX is trying to calculate the total)
4) Use ALLSELECTED() in the Spotify table to mimic DAX calculating the total in the table or matrix
VAR T =
SWITCH (
TRUE (),
SELECTEDVALUE ('Dimension Slicer'[Dimension] ) = "Album", CALCULATE ( [Avg Tempo], ALLSELECTED ( Spotify[Album] ) ),
SELECTEDVALUE ( 'Dimension Slicer'[Dimension]) = "Key Name", CALCULATE ( [Avg Tempo], ALLSELECTED ( Spotify[key_name] ) )
)
5) RETURN
IF ( ISBLANK ( SV ), T, N )
Learn how to change the column values in your Power BI visuals based on a slicer selection. One of my favorite DAX solutions using a calculated table and a measure. Can be useful to create different report views (switching column values in a single visual).
Also, welcome to my first OFFICIAL Power BI tutorial :D
► Music Credit: LAKEY INSPIRED
Track Name: "Blue Boi"
License for commercial use: Creative Commons Attribution 3.0 Unported "Share Alike" (CC BY-SA 3.0) License.
1) Edit your Avg Tempo Dimension Slicer Measure
2) Set your original switch statement to the variable N
3) Create a new variable called T to take care of the scenario in which SELECTEDVALUE() is BLANK() (AKA when DAX is trying to calculate the total)
4) Use ALLSELECTED() in the Spotify table to mimic DAX calculating the total in the table or matrix
VAR T =
SWITCH (
TRUE (),
SELECTEDVALUE ('Dimension Slicer'[Dimension] ) = "Album", CALCULATE ( [Avg Tempo], ALLSELECTED ( Spotify[Album] ) ),
SELECTEDVALUE ( 'Dimension Slicer'[Dimension]) = "Key Name", CALCULATE ( [Avg Tempo], ALLSELECTED ( Spotify[key_name] ) )
)
5) RETURN
IF ( ISBLANK ( SV ), T, N )
Learn how to change the column values in your Power BI visuals based on a slicer selection. One of my favorite DAX solutions using a calculated table and a measure. Can be useful to create different report views (switching column values in a single visual).
Also, welcome to my first OFFICIAL Power BI tutorial :D
► Music Credit: LAKEY INSPIRED
Track Name: "Blue Boi"
License for commercial use: Creative Commons Attribution 3.0 Unported "Share Alike" (CC BY-SA 3.0) License.
Комментарии