The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I need a dax query that count the number of quarters based on the quarters and years data, it must not be distinct.
eg. year 2020 quarters Q1, Q2, Q3, Q4 No.of quarters: 4
if selected 2years in the slicer then:
2020 has four quarters data called Q1, Q2, Q3, Q4
2021 has three quarters data called Q1, Q2, Q3
so, the overall count of quarters must be 7.
Similarly, for all the selected years. - count of years and each year how many quarters it is has.
It needs to show the count. It should not count the blanks.
here- when taken distinct count of quarter it shows 5 which is not expected, when taken count of quarter it shows the count of quarter records and led to 99 count. I expect the count to be 8- 2years and they have 4quarters each so the count should be 2*4=8.
Thank you for your help in advance!
Solved! Go to Solution.
Measure19 =
COUNTROWS (
FILTER (
SUMMARIZE (
'vcontacts and TO SUPPLIER DOC',
'vcontacts and TO SUPPLIER DOC'[QUARTER],
'vcontacts and TO SUPPLIER DOC'[YEAR]
),
'vcontacts and TO SUPPLIER DOC'[QUARTER] <> BLANK ()
)
)
Your query is right only write COUNTROWS instead of DISTINCTCOUNT
Hi @Haripinnoju
please try
Measure8 =
COUNTROWS (
SUMMARIZE (
'vcontacts and TO SUPPLIER DOC',
'vcontacts and TO SUPPLIER DOC'[QUARTER],
'vcontacts and TO SUPPLIER DOC'[YEAR]
)
)
thank you,
how to remove the blank quarter count from it.
It must show only 8. It should count only the quarter which has data in it.
Measure19 =
COUNTROWS (
FILTER (
SUMMARIZE (
'vcontacts and TO SUPPLIER DOC',
'vcontacts and TO SUPPLIER DOC'[QUARTER],
'vcontacts and TO SUPPLIER DOC'[YEAR]
),
'vcontacts and TO SUPPLIER DOC'[QUARTER] <> BLANK ()
)
)
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |