March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
i have this table
customer | date | transaction type | amount |
1 | 1/1/2022 | digital | 10 |
1 | 1/2/2022 | digital | 20 |
1 | 1/3/2022 | digital | 30 |
1 | 1/4/2022 | digital | 11 |
1 | 1/5/2022 | digital | 48 |
1 | 1/6/2022 | digital | 69 |
1 | 1/1/2022 | physical | 45 |
1 | 1/2/2022 | physical | 85 |
1 | 1/3/2022 | physical | 96 |
1 | 1/4/2022 | physical | 47 |
1 | 1/5/2022 | physical | 6 |
1 | 1/6/2022 | physical | 22 |
2 | 1/1/2022 | digital | 10 |
2 | 1/2/2022 | digital | 20 |
2 | 1/3/2022 | digital | 30 |
2 | 1/4/2022 | digital | 11 |
2 | 1/5/2022 | digital | 48 |
2 | 1/6/2022 | digital | 69 |
2 | 1/1/2022 | physical | 45 |
2 | 1/2/2022 | physical | 85 |
2 | 1/3/2022 | physical | 96 |
2 | 1/4/2022 | physical | 47 |
2 | 1/5/2022 | physical | 6 |
2 | 1/6/2022 | physical | 22 |
2 | 1/1/2022 | digital | 10 |
2 | 1/2/2022 | digital | 20 |
2 | 1/3/2022 | digital | 30 |
2 | 1/4/2022 | digital | 11 |
2 | 1/5/2022 | digital | 48 |
2 | 1/6/2022 | digital | 69 |
2 | 1/1/2022 | physical | 45 |
2 | 1/2/2022 | physical | 85 |
2 | 1/3/2022 | physical | 96 |
2 | 1/4/2022 | physical | 47 |
2 | 1/5/2022 | physical | 6 |
2 | 1/6/2022 | physical | 22 |
for each customer i want to calculate the ratio digital / total transactions (digital+physical) amount in the last 3 months
a customers that has ratio >0.5 (digital transactions more than 50% of his total transactions is a digital customer
I want when selecting a month form a slicer (example 01/06/2022) to count the customers of this month that have a >0.5 in the last 3 months of this selection.
Solved! Go to Solution.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
=
COUNTROWS(
FILTER(
VALUES( TXN[customer] ),
CALCULATE(
CALCULATE( [Total], TXN[transaction type] = "digital" ) / [Total],
DATESINPERIOD( DATES[Date], MAX( DATES[Date] ), -3, MONTH )
) > .5
)
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
can the dax be modified so it shows in a card the distinct count of customers for this? (>0.5)?
To obtain the same visual effect as Card,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
I would like to count the customers. Example 4 customers in this month had digital ratio (3 month transactions) >0.5
=
COUNTROWS(
FILTER(
VALUES( TXN[customer] ),
CALCULATE(
CALCULATE( [Total], TXN[transaction type] = "digital" ) / [Total],
DATESINPERIOD( DATES[Date], MAX( DATES[Date] ), -3, MONTH )
) > .5
)
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thanks worked great!
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
89 | |
85 | |
73 | |
49 |
User | Count |
---|---|
167 | |
149 | |
98 | |
73 | |
57 |