Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi All,
I have created below table at UI. Created to measures (Measure1 & Measure 2) using What If parameter. In Primary/Secoundary column I am assigning value on comparing Measure1 & Measure 2. So I can't replicated the measures as calculated column.
If Measure1 < Measure 2 than Primary else Secoundary
My requirement is to show count of Primary/Secoundarys column in card at UI. So count will come as 2 Primary and 1 Secoundary in individal data cards.
Resource | Type | ID | Measure1 | Measure2 | Primary/Secoundary |
abc | Active | 1 | 45 | 67 | Primary |
ed | Active | 2 | 89 | 45 | Secoundary |
xyz | Passive | 3 | 21 | 99 | Primary |
If anyone has come across with same scenarieo then please advice how to display the data.
Regards
Vaishali
Solved! Go to Solution.
Hi @Vaishali04
Create a variable table in the DAX measure and then you can use count() function in it.
Try measures like:
Primary Count =
VAR _table = SELECTCOLUMNS('Table',"Resource",'Table'[Resource],"Type",'Table'[Type],"ID",'Table'[ID],"Primary/Secondary",[Primary/Secondary])
VAR _countPrimary = COUNTROWS(FILTER(_table,[Primary/Secondary]="Primary"))
RETURN
_countPrimary
Secondary Count =
VAR _table = SELECTCOLUMNS('Table',"Resource",'Table'[Resource],"Type",'Table'[Type],"ID",'Table'[ID],"Primary/Secondary",[Primary/Secondary])
VAR _countPrimary = COUNTROWS(FILTER(_table,[Primary/Secondary]="Secondary"))
RETURN
_countPrimary
Test result:
Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
Hi @Vaishali04 ,
Can you try the below dax in calculated measure and pull it in Card:
For Primary Count:
Primary Count = CALCULATE(COUNT('TableName'[Primary/Secondary]), FILTER(TableName ,MAX(TableName[Primary/Secondary])="Primary")
For Secondary Count:
Secondary Count = CALCULATE(COUNT('TableName'[Primary/Secondary]), FILTER(TableName ,MAX(TableName[Primary/Secondary])="Secondary ")
Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!
Hi @Anand24
Primary/Secondary column in the table is a measure not a column in table 'TableName'[Primary/Secondary]). So Count(Primary/Secondary) is not valid statement.
Hi @Vaishali04
Create a variable table in the DAX measure and then you can use count() function in it.
Try measures like:
Primary Count =
VAR _table = SELECTCOLUMNS('Table',"Resource",'Table'[Resource],"Type",'Table'[Type],"ID",'Table'[ID],"Primary/Secondary",[Primary/Secondary])
VAR _countPrimary = COUNTROWS(FILTER(_table,[Primary/Secondary]="Primary"))
RETURN
_countPrimary
Secondary Count =
VAR _table = SELECTCOLUMNS('Table',"Resource",'Table'[Resource],"Type",'Table'[Type],"ID",'Table'[ID],"Primary/Secondary",[Primary/Secondary])
VAR _countPrimary = COUNTROWS(FILTER(_table,[Primary/Secondary]="Secondary"))
RETURN
_countPrimary
Test result:
Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
User | Count |
---|---|
64 | |
59 | |
47 | |
32 | |
31 |
User | Count |
---|---|
84 | |
73 | |
52 | |
50 | |
44 |