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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
zxl1031
Helper I
Helper I

Create a table to include measures

Hello everyone,

I have 7 measures and I want to visualize them in a bar chart . X-axis is the measure name (sorted from "0%", "<5%", "5%-10%" etc.), Y-axis is the caulcated value of each measure. 

So I created a table using below DAX, bold red is each individual measure

MeasurementTable =
UNION(
ROW("cat",">50%", "count_vin",[>50%],"groupid",1),
ROW("cat","30%-40%", "count_vin", [30%-40%],"groupid",2),
ROW("cat","20%-30%", "count_vin",[20%-30%],"groupid",3),
ROW("cat","10%-20%", "count_vin",[10%-20%],"groupid",4),
ROW("cat","5%-10%", "count_vin",[5%-10%],"groupid",5),
ROW("cat","<5%", "count_vin",[<5%],"groupid",6),
ROW("cat","0%", "count_vin",[0%],"groupid",7)
)

 

However, as you can see in below picuture, the value of each measure in this MeasureTable is different from individual measure. And it seems in MeasureTable, all filters are not applied at all. 

 

Can anyone help explain why and a possible solution?

 

zxl1031_0-1610062881617.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@zxl1031 , In the second table filter will not apply. As New table will not tabke slicer value.

 

Instead of so many measures try to use the approch of dynamic segmentation

https://www.youtube.com/watch?v=CuczXPj0N-k

 

Create an independent table, With ranges , create new measures with a row context.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @zxl1031,

Did these suggestions help with your scenario? If not, you can feel free to post here with detailed information.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @zxl1031,

Current power bi does not support create dynamic calculated tables/columns based on filters or slicers. Please write measure expressions and use them with category to instead.

Category =
UNION (
    ROW ( "cat", ">50%", "groupid", 1 ),
    ROW ( "cat", "30%-40%", "groupid", 2 ),
    ROW ( "cat", "20%-30%", "groupid", 3 ),
    ROW ( "cat", "10%-20%", "groupid", 4 ),
    ROW ( "cat", "5%-10%", "groupid", 5 ),
    ROW ( "cat", "<5%", "groupid", 6 ),
    ROW ( "cat", "0%", "groupid", 7 )
)
Measure =
VAR selection =
    SELECTEDVALUE ( Category[cat] )
RETURN
    SWITCH (
        selection,
        ">50%", [>50%],
        "30%-40%", [30%-40%],
        "20%-30%", [20%-30%],
        "10%-20%", [10%-20%],
        "5%-10%", [5%-10%],
        "<5%", [<5%],
        "0%", [0%]
    )

Notice: the data level of power bi.
Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@zxl1031 , In the second table filter will not apply. As New table will not tabke slicer value.

 

Instead of so many measures try to use the approch of dynamic segmentation

https://www.youtube.com/watch?v=CuczXPj0N-k

 

Create an independent table, With ranges , create new measures with a row context.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.