Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am having an issue with a simple filter for a new measure.
Following settup:
In the measure Attribute Name different text values like Brand, Gendre etc. are included
Hereby the Attribute Value gives out the corresponding value like men or woman.
I tried to calculate a new measure using the calculate and all formula to just show the different brands.
Solved! Go to Solution.
Hi @NickCC ,
I created some data:
Do you want to use Dax to achieve the following effects:
Here are the steps you can follow:
If [Attribute Value] is not a duplicate value in your data, you can try the following dax:
no - repetitive =
MAXX(
FILTER(ALL('Table'),[AttributeName]="Marke"&&'Table'[Attribute Value]=MAX('Table'[Attribute Value])),[Attribute Value])
If your [Attribute Value] is a duplicate value, you can create an index to mark it.
Add Column – Index Column – From 1.
repetitive =
MAXX(
FILTER(ALL('Table'),[AttributeName]="Marke"&&'Table'[Index]=MAX('Table'[Index])),[Attribute Value])
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @NickCC ,
I created some data:
Do you want to use Dax to achieve the following effects:
Here are the steps you can follow:
If [Attribute Value] is not a duplicate value in your data, you can try the following dax:
no - repetitive =
MAXX(
FILTER(ALL('Table'),[AttributeName]="Marke"&&'Table'[Attribute Value]=MAX('Table'[Attribute Value])),[Attribute Value])
If your [Attribute Value] is a duplicate value, you can create an index to mark it.
Add Column – Index Column – From 1.
repetitive =
MAXX(
FILTER(ALL('Table'),[AttributeName]="Marke"&&'Table'[Index]=MAX('Table'[Index])),[Attribute Value])
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
It looks like you're trying to create a measure to filter and display only the values corresponding to the "Brand" attribute in your data model. However, the DAX expression you provided seems to be missing a key component to achieve this.
Here's a revised version of your measure that should work:
```dax
Brand =
CALCULATE(
VALUES(ArticleAttributes[Attribute Value]),
FILTER(
ArticleAttributes,
ArticleAttributes[Attribute Name] = "Marke"
)
)
```
This measure uses the CALCULATE function along with VALUES and FILTER to filter the values in the "ArticleAttributes" table where the "Attribute Name" is equal to "Marke". It then returns the distinct values of the "Attribute Value" column for the filtered rows.
Make sure to replace "ArticleAttributes" with the actual name of your table containing the attribute data.
You can use this "Brand" measure in your Power BI visuals to display the distinct brands based on the "Marke" attribute. If you encounter any issues or have further questions, feel free to ask!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Sadly it doesn't work.
If I let the Measure "Attribute Value" be displayed in a table and use the visual filter (inserting Attribue Name -> "Marke") it works.
What could be the problem?
there could be a few potential reasons for this discrepancy:
Context Transition: Calculated measures in Power BI operate within a context, which may differ from the context applied by visual filters. If the measure isn't correctly handling context transition, it may not produce the expected results.
Relationships: Ensure that there is a proper relationship established between the tables involved in your calculation. If the tables are not related correctly, the measure may not filter the data as expected.
Filter Propagation: Verify that the filter is being propagated correctly through the data model. If the filter is not applied to all relevant tables, the measure may not return the expected results.
Data Model Structure: Review the structure of your data model to ensure that it aligns with your intended analysis. Check for any inconsistencies or unexpected behaviors in the data model that may affect the measure's calculation.
Debugging: Use DAX Studio or Power BI's built-in tools to debug and troubleshoot the measure. You can evaluate the measure in different contexts to identify any issues with its calculation logic.
Syntax Errors: Double-check the syntax of your DAX measure to ensure that it is correctly written and references the appropriate columns and tables.
User | Count |
---|---|
96 | |
85 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
96 | |
96 | |
67 | |
59 |