The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi everyone,
I am new Power Bi learner,
I am facing an issue while creating a measure such that, I am having table - "Data Dump"
For countries IN, KR, CN, the meaure should reflect their respective count of docs
and for countries TW, SG, TH, measure should reflect there respective distinct count of docs.
My Effort:
DocCount = CALCULATE(IF('Data Dump'[Country] = "IN" || "KR" || "CN", COUNT('Data Dump'[Doc]), DISTINCTCOUNT('Data Dump'[Doc]))
Solved! Go to Solution.
Try this one:
DocCount =
IF (
MAX('Data Dump'[Country]) IN { "IN", "KR", "CN" },
COUNT ( 'Data Dump'[Doc] ),
DISTINCTCOUNT ( 'Data Dump'[Doc] )
)
Pbix attached,
Try this one:
DocCount =
IF (
MAX('Data Dump'[Country]) IN { "IN", "KR", "CN" },
COUNT ( 'Data Dump'[Doc] ),
DISTINCTCOUNT ( 'Data Dump'[Doc] )
)
Pbix attached,
That's to specify the current value in the column.
@CrazyExcelor , Try like
DocCount = CALCULATE(IF('Data Dump'[Country] in { "IN" , "KR" , "CN"}, COUNT('Data Dump'[Sales Document]), DISTINCTCOUNT('Data Dump'[Sales Document])))
Issue I am facing is, IF is not taking non measure column as a value .. it's not detecting 'Data Dump'[Country]
Try this.
DocCount =
IF (
'Data Dump'[Country] IN { "IN", "KR", "CN" },
COUNT ( 'Data Dump'[Sales Document] ),
DISTINCTCOUNT ( 'Data Dump'[Sales Document] )
)
Issue I am facing is, IF is not taking non measure column as a value .. it's not detecting 'Data Dump'[Country]
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
80 | |
77 | |
46 | |
39 |
User | Count |
---|---|
141 | |
110 | |
64 | |
64 | |
53 |